Heyuan 6 ay önce
ebeveyn
işleme
bd2a703088

+ 3400 - 2890
js/deploy/easweb.ear/eas_web.war/bin/workflow/metas/js/approve.js

@@ -1,2917 +1,3427 @@
-mod.definePage("workflow/metas/js/approve", function (waf, wfCommonUtil) {
-    var _public = {},
-        _private = {},
-        me = _self;
-    var okPolicy = new Array();
-    var noPolicy = new Array();
-    var assign = {};
-    var selnextPersons = {};
-    var transId = null;
-    var locationurl = waf.getUrlParams(document.location.href);
-    var approvetype = locationurl.type;
-    var passId = locationurl.passid;
-    var sourceIDs = locationurl.sourceIDs;
-    var msgId = locationurl.msgId;
-    var showerror = "";
-    var nextActIndex = "#nextAct";
-    var approveOpinions = {};
-    var isFirst = true;
-    var approvePolicy = {};
-    var riskInsight = false;
-    var billInsightOption = {};
-    var caConfig = {
-        caConfigInfo: null,
-        rootDiv: null,
-        CA_plainText: null,
-        CA_signature: null,
-        plainTextMap: null,
-        plainSignatureMap: null
-    };
-    waf.extend(_public, {
-        submit: function (event, value) {
-            return _private.submit(event, value)
-        },
-        save: function (event, value) {
-            return _private.save(event, value)
-        },
-        deliver: function (event, value) {
-            return _private.deliver(event, value)
-        },
-        passAssignment: function (event, value) {
-            return _private.passAssignment(event, value)
-        },
-        kickback: function (event, value) {
-            return _private.kickback(event, value)
-        },
-        appendActivity: function (event, value) {
-            return _private.appendActivity(event, value)
-        },
-        dynamicSign: function (event, value) {
-            return _private.dynamicSign(event, value)
-        },
-        jumpto: function (event, value) {
-            return _private.jumpto(event, value)
-        },
-        viewProcessDiagram: function (event, value) {
-            return _private.viewProcessDiagram(event, value)
-        },
-        billImage: function (event, value) {
-            return _private.billImage(event, value)
-        },
-        bill: function (event, value) {
-            return _private.bill(event, value)
-        },
-        showoperate: function (event, value) {
-            return _private.showoperate(event, value)
-        },
-        nextActs: function (event, ui) {
-            return _private.nextActs(event, ui)
-        },
-        modifynextActs: function (event, value) {
-            return _private.modifynextActs(event, value)
-        },
-        changePolicy: function (event, ui) {
-            return _private.changePolicy(event, ui)
-        },
-        changeselPolicy: function (event, ui) {
-            return _private.changeselPolicy(event, ui)
-        },
-        myPhrase: function (event, value) {
-            return _private.myPhrase(event, value)
-        },
-        openPerson: function (event, value) {
-            return _private.openPerson(event, value)
-        },
-        esignatureOnClick: function (event, ui) {
-            return _private.esignatureOnClick(event, ui)
-        },
-        nextAct: function (event, ui) {
-            return _private.nextAct(event, ui)
-        },
-        modifynextAct: function (event, value) {
-            return _private.modifynextAct(event, value)
-        },
-        pageOnload: function (e) {
-            return _private.pageOnload(e)
-        },
-        pageOnRenderBefore: function (e) {
-            return _private.pageOnRenderBefore(e)
-        },
-        phrasedel: function (e) {
-            return _private.phrasedel(e)
-        },
-        phrasesure: function (e) {
-            return _private.phrasesure(e)
-        },
-        addphrase: function (e) {
-            return _private.addphrase(e)
-        },
-        phraseback: function (e) {
-            return _private.phraseback(e)
-        },
-        phraseadd: function (e) {
-            return _private.phraseadd(e)
-        },
-        reloadTranId: function () {
-            return _private.reloadTranId()
-        },
-        getnextacts: function () {
-            return _private.getnextacts()
-        },
-        showtab: function () {
-            return _private.showtab()
-        },
-        setmanualdecision: function () {
-            return _private.setmanualdecision()
-        },
-        setmodifynextAct: function () {
-            return _private.setmodifynextAct()
-        },
-        getbatchlist: function () {
-            return _private.getbatchlist()
-        },
-        displayBillInfo: function (url) {
-            return _private.displayBillInfo(url)
-        },
-        getPolicy: function (approveValueStr) {
-            return _private.getPolicy(approveValueStr)
-        },
-        setPolicy: function (val) {
-            return _private.setPolicy(val)
-        },
-        isNeedDefaultOption: function (vals) {
-            return _private.isNeedDefaultOption(vals)
-        },
-        setsendmailormsg: function (isOpenMessageSendOnUI, notifyNextBySMS, notifyNextByMail) {
-            return _private.setsendmailormsg(isOpenMessageSendOnUI, notifyNextBySMS, notifyNextByMail)
-        },
-        resizePage: function () {
-            return _private.resizePage()
-        },
-        showapprovehis: function (procInstId) {
-            return _private.showapprovehis(procInstId)
-        },
-        showbtn: function () {
-            return _private.showbtn()
-        },
-        setselnextperson: function (actId, name, id) {
-            return _private.setselnextperson(actId, name, id)
-        },
-        loadNextActs: function () {
-            return _private.loadNextActs()
-        },
-        getOpinion: function (actInstId, assignId, billId) {
-            return _private.getOpinion(actInstId, assignId, billId)
-        },
-        getphrase: function () {
-            return _private.getphrase()
-        },
-        setselnextactperson: function (resultStr) {
-            return _private.setselnextactperson(resultStr)
-        },
-        shownextActs: function (nextactname, ui) {
-            return _private.shownextActs(nextactname, ui)
-        },
-        passComentsubmit: function () {
-            return _private.passComentsubmit()
-        },
-        initCAConfig: function (tCAConfig) {
-            return _private.initCAConfig(tCAConfig)
-        },
-        batchSubmitForCA: function () {
-            return _private.batchSubmitForCA()
-        },
-        checkCAPassword: function (isBatch) {
-            return _private.checkCAPassword(isBatch)
-        },
-        batchSubmit: function () {
-            return _private.batchSubmit()
-        },
-        getbatchid: function () {
-            return _private.getbatchid()
-        },
-        _batchsubmit: function (info) {
-            return _private._batchsubmit(info)
-        },
-        getApprove: function () {
-            return _private.getApprove()
-        },
-        beforeBatchSubmitSigature: function (selectBillIds) {
-            return _private.beforeBatchSubmitSigature(selectBillIds)
-        },
-        getNextPersons: function (isSave) {
-            return _private.getNextPersons(isSave)
-        },
-        manualdecisionsubmit: function () {
-            return _private.manualdecisionsubmit()
-        },
-        beforeInnerSubmit: function () {
-            return _private.beforeInnerSubmit()
-        },
-        innerSubmit: function () {
-            return _private.innerSubmit()
-        },
-        _submit: function (isReadOnly) {
-            return _private._submit(isReadOnly)
-        },
-        beforeSubmitSigature: function () {
-            return _private.beforeSubmitSigature()
-        },
-        toDecimal: function (src, pos) {
-            return _private.toDecimal(src, pos)
-        },
-        checkIsSave: function (callback, type) {
-            return _private.checkIsSave(callback, type)
-        },
-        _save: function (isReadOnly) {
-            return _private._save(isReadOnly)
-        },
-        backto: function () {
-            return _private.backto()
-        },
-        addUploadHtml: function () {
-            return _private.addUploadHtml()
-        },
-        getAttchmentcount: function () {
-            return _private.getAttchmentcount()
-        },
-        selattachment: function (item, attcreater, beizhu) {
-            return _private.selattachment(item, attcreater, beizhu)
-        },
-        attachmentDelete: function (item, id) {
-            return _private.attachmentDelete(item, id)
-        },
-        attachmentView: function (id, type) {
-            return _private.attachmentView(id, type)
-        },
-        isWaf1Bill: function (url) {
-            return _private.isWaf1Bill(url)
-        },
-        messageDigest: function () {
-            return _private.messageDigest()
-        },
-        jMessageAlert: function (message) {
-            return _private.jMessageAlert(message)
-        },
-        onselect: function (event, ui) {
-            return _private.onselect(event, ui)
-        },
-        addphrase: function () {
-            return _private.addphrase()
-        },
-        openAttachmentPage: function (event, value) {
-            return _private.openAttachmentPage(event, value)
-        },
-        getAssignInfo: function () {
-            return _private.getAssignInfo()
-        }
-    });
-    _self.subscribeEvent("pageOnLoadEvent", _public.pageOnload, "after");
-    _self.subscribeEvent("pageOnRenderEvent", _public.pageOnRenderBefore, "before");
-    _self.subscribeEvent("phrasedelActionEvent", _public.phrasedel, "overwrite");
-    _self.subscribeEvent("phrasesureActionEvent", _public.phrasesure, "overwrite");
-    _self.subscribeEvent("phrasebackActionEvent", _public.phraseback, "overwrite");
-    _self.subscribeEvent("phraseaddActionEvent", _public.phraseadd, "overwrite");
-    waf.extend(_private, {
-        modifyNextAct: "#modifynextAct",
-        charFrameId: "predictionChartIframe",
-        curTab: "",
-        leftPanelWidth: "",
-        rightPanelWidth: "",
-        isPredict: true,
-        displayBillInfo: function (url) {
-            if (assign.attachmentMode) {
-                if (!url.endsWith("nobill.html")) {
-                    url += "&hasAttachment=false"
-                }
-            }
-            waf("#billFrame").wafIframe("option", "src", url)
-        },
-        getPolicy: function (approveValueStr) {
-            if (approveValueStr == null || approveValueStr == "") {
-                approveValueStr = "0;" + _self._localeStr.WEB_AGREE + ";" + _self._localeStr.WEB_AGREE + ";:1;" + _self._localeStr.WEB_DISAGREE + ";" + _self._localeStr.WEB_DISAGREE + ";"
-            }
-            var strs = approveValueStr.split(":");
-            for (var i = 0; i < strs.length; i++) {
-                var strTemp = strs[i].split(";");
-                var key = strTemp[0];
-                var text = strTemp[1];
-                var type = strTemp.length == 2 ? _self._localeStr.WEB_ALL : strTemp[2];
-                var line = strTemp.length < 4 ? "" : strTemp[3];
-                var o = {};
-                o.alias = text;
-                o.value = key;
-                if ("agree" == type || type == _self._localeStr.WEB_AGREE || "同意" == type) {
-                    okPolicy.push(o)
-                } else {
-                    if ("disagree" == type || type == _self._localeStr.WEB_DISAGREE || "不同意" == type) {
-                        noPolicy.push(o)
-                    } else {
-                        if ("all" == type || type == _self._localeStr.WEB_ALL || "全部" == type) {
-                            okPolicy.push(o);
-                            noPolicy.push(o)
-                        }
-                    }
-                }
-            }
-        },
-        setPolicy: function (val) {
-            if (val == "true") {
-                if (isFirst) {
-                    isFirst = false
-                } else {
-                    approveOpinions.disagree = $("#approveOpinion").val();
-                    approvePolicy.disagree = waf("#policy").wafSelect("getValue")
-                }
-                if (approvePolicy.agree) {
-                    waf("#policy").wafSelect("setValue", approvePolicy.agree)
-                }
-                $("#approveOpinion").val(approveOpinions.agree);
-                waf("#policy").wafSelect("option", "enumSource", okPolicy)
-            } else {
-                if (isFirst) {
-                    isFirst = false
-                } else {
-                    approveOpinions.agree = $("#approveOpinion").val();
-                    approvePolicy.agree = waf("#policy").wafSelect("getValue")
-                }
-                if (approvePolicy.disagree) {
-                    waf("#policy").wafSelect("setValue", approvePolicy.disagree)
-                }
-                $("#approveOpinion").val(approveOpinions.disagree);
-                waf("#policy").wafSelect("option", "enumSource", noPolicy)
-            }
-            _private.reloadTranId();
-            if (waf(nextActIndex).wafCheckbox("isChecked")) {
-                _private.loadNextActs()
-            }
-        },
-        isNeedDefaultOption: function (vals) {
-            if (assign.isNeedDefaultOption) {
-                waf("#approveOpinion").val(vals)
-            }
-            if (assign.defaultOpinion != null && assign.defaultOpinion != "") {
-                waf("#approveOpinion").val(assign.defaultOpinion)
-            }
-        },
-        getDefaultOption: function (vals) {
-            if (assign.isNeedDefaultOption) {
-                approveOpinions = {
-                    agree: _self._localeStr.WEB_AGREE,
-                    disagree: _self._localeStr.WEB_DISAGREE
-                }
-            }
-            if (assign.defaultOpinion != null && assign.defaultOpinion != "") {
-                approveOpinions = {
-                    agree: assign.defaultOpinion,
-                    disagree: assign.defaultOpinion
-                }
-            }
-        },
-        setsendmailormsg: function (isOpenMessageSendOnUI, notifyNextBySMS, notifyNextByMail) {
-            waf("#issendmsgormail").wafPanel("option", "hidden", !isOpenMessageSendOnUI);
-            waf("#sendmsg").wafCheckbox("option", "hidden", !isOpenMessageSendOnUI);
-            waf("#sendmail").wafCheckbox("option", "hidden", !isOpenMessageSendOnUI);
-            waf("#sendmsg").wafCheckbox("setChecked", notifyNextBySMS);
-            waf("#sendmail").wafCheckbox("setChecked", notifyNextByMail)
-        },
-        resizePage: function () {
-            var rightwidth = Math.ceil((300 / window.innerWidth) * 100);
-            if (window.screen.width <= 1366) {
-                rightwidth = 21
-            }
-            var leftwidth = 100 - rightwidth;
-            waf("#splitPanel").wafSplitPanel("option", {
-                split: false,
-                leftWidth: leftwidth,
-                rightWidth: rightwidth
-            });
-            var billHeightOffset = 220;
-            var tabOffset = 100;
-            if (assign.newPage && approvetype == "approve") {
-                billHeightOffset = 160;
-                tabOffset = 155
-            }
-            if (approvetype != "approve") {
-                billHeightOffset -= 120
-            }
-            $("#tabs .ui-waftabs-panel").eq(0).height(window.innerHeight - tabOffset);
-            if (approvetype == "batchapprove") {
-                if (assign.batchApproveUrl) {
-                    var times = 0;
-                    waf("#billFrame").wafIframe("option", "height", window.innerHeight - 100);
-                    var interval = setInterval(function () {
-                        try {
-                            window.frames.billFrame.$("#gview_queryGrid .ui-jqgrid-bdiv").eq(0).css("height", window.innerHeight - 220);
-                            if (times > 4) {
-                                clearInterval(interval)
-                            }
-                            times++
-                        } catch (e) { }
-                    }, 500);
-                    waf("#billFrame").wafIframe("option", "scrolling", "auto")
-                } else {
-                    $("#gview_queryGrid .ui-jqgrid-bdiv").height($("#tabs").height() - 100);
-                    $("#gview_queryGrid .ui-jqgrid-bdiv").css("overflow-y", "auto");
-                    $("#panel5 .ui-jqgrid").height($("#tabs").height())
-                }
-            } else {
-                if (assign.messageDigest) {
-                    $("#panel5").css({
-                        height: window.innerHeight - billHeightOffset,
-                        "overflow-y": "auto",
-                        "overflow-x": "hidden"
-                    });
-                    $("#bill_content").css({
-                        height: window.innerHeight - billHeightOffset,
-                        overflow: "auto"
-                    })
-                } else {
-                    waf("#billFrame").wafIframe("option", "height", window.innerHeight - billHeightOffset);
-                    waf("#billFrame").wafIframe("option", "scrolling", "auto")
-                }
-            }
-            if (assign.absStr || assign.decisionDesc) {
-                _private.changeBillHeight(90, false)
-            }
-            if (approvetype == "batchapprove" || approvetype == "approve") {
-                $("#myPhraseList .scrollhid").height($("#approveTask").height() - 100)
-            }
-        },
-        changeBillHeight: function (height, isClose) {
-            var billHeight = 0;
-            if (assign.messageDigest) {
-                billHeight = $("#panel5").height()
-            } else {
-                billHeight = waf("#billFrame").wafIframe("option", "height")
-            }
-            if (isClose) {
-                billHeight += height
-            } else {
-                billHeight -= height
-            }
-            if (assign.messageDigest) {
-                $("#panel5").css({
-                    height: billHeight,
-                    "overflow-y": "auto"
-                })
-            } else {
-                waf("#billFrame").wafIframe("option", "height", billHeight);
-                waf("#billFrame").wafIframe("option", "scrolling", "auto")
-            }
-        },
-        showapprovehis: function (procInstId) {
-            var params = {};
-            params.embed = "true";
-            params.proInstId = procInstId;
-            waf.doPost({
-                url: waf.getContextPath() + "/flowRelated.do?method=getFlowRealted",
-                data: params,
-                success: function (data) {
-                    var _html = "";
-                    for (var i = 0; i < data.length; i++) {
-                        var action = data[i].action;
-                        var node = data[i].node;
-                        if (node == null) {
-                            node = ""
-                        }
-                        var operatorResult = data[i].operatorResult;
-                        if (operatorResult == "" || operatorResult == null) {
-                            operatorResult = action
-                        }
-                        var op = "";
-                        var operatorOpinion = data[i].operatorOpinion;
-                        if (operatorOpinion == "" || operatorOpinion == null) {
-                            operatorOpinion = ""
-                        }
-                        var classname = "agree";
-                        var type = data[i].type;
-                        var titlename = "";
-                        if (type == 9 || type == 10) {
-                            var operatorResults = operatorResult.split(",");
-                            if (operatorResults.length == 2) {
-                                op += "<span title=" + _self._localeStr.WEB_APPROVALRESULTS + ">" + _self._localeStr.WEB_APPROVALRESULTS + ":</span><span title='" + operatorResults[0] + "'>" + operatorResults[0] + "</span><br/>";
-                                op += "<span title=" + _self._localeStr.WEB_HANDLEROPINIONS + ">" + _self._localeStr.WEB_HANDLEROPINIONS + ":</span><span title='" + operatorResults[1] + "'>" + operatorResults[1] + "</span><br/>";
-                                if (operatorResults[0] == _self._localeStr.WEB_DISAGREE || operatorResults[0] == "Disagree") {
-                                    classname = "disagree"
-                                }
-                            } else {
-                                op += "<span title='" + operatorResult + "'>" + operatorResult + "</span><br/>"
-                            }
-                            titlename = _self._localeStr.WEB_APPROVALCOMMENTS
-                        } else {
-                            op += "<span title='" + operatorResult + "'>" + operatorResult + "</span><br/>";
-                            if (type == 1) {
-                                classname = "jump";
-                                titlename = _self._localeStr.WEB_JUMPCOMMENTS
-                            } else {
-                                if (type == 2) {
-                                    classname = "append";
-                                    titlename = _self._localeStr.WEB_COUNTERSIGNCOMMENTS
-                                } else {
-                                    if (type == 4) {
-                                        classname = "stop";
-                                        titlename = _self._localeStr.WEB_ENDCOMMENTS
-                                    } else {
-                                        if (type == 3) {
-                                            classname = "deliver";
-                                            titlename = _self._localeStr.WEB_TRANSFERRCOMMENTS
-                                        } else {
-                                            if (type == 0) {
-                                                classname = "jump";
-                                                titlename = _self._localeStr.WEB_REJECTCOMMENTS
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                        if (titlename != "") {
-                            op += "<span title='" + titlename + "'>" + titlename + ":</span><span title='" + operatorOpinion + "'>" + operatorOpinion + "</span><br/>"
-                        }
-                        if (i > 0) {
-                            if (data[i].node == data[i - 1].node) {
-                                _html += '<div class="infos">	<div class="content">		<div class="title">			<i></i>			<span style="float:left;">' + data[i].operatorTime + '</span>			<span style="float:right;">' + data[i].operator + '</span>		</div>		<div class="op">' + op + "</div>	</div></div>";
-                                if (i != data.length - 1) {
-                                    if (data[i].node != data[i + 1].node) {
-                                        _html += "</div></li>"
-                                    }
-                                }
-                                continue
-                            }
-                        }
-                        _html += '<li><div class="node">	<i class="' + classname + '"></i>	<span>' + node + "</span></div>";
-                        if (i != data.length - 1) {
-                            if (data[i].node == data[i + 1].node) {
-                                _html += '<div class="info"><div class="infos">'
-                            } else {
-                                _html += '<div class="info">'
-                            }
-                        } else {
-                            _html += '<div class="info">'
-                        }
-                        _html += '	<div class="content">		<div class="title">';
-                        if (i != data.length - 1) {
-                            if (data[i].node == data[i + 1].node) {
-                                _html += "<i></i>"
-                            }
-                        }
-                        _html += '			<span style="float:left;">' + data[i].operatorTime + '</span>			<span style="float:right;">' + data[i].operator + '</span>		</div>		<div class="op">' + op + "</div>	</div></div>";
-                        if (i != data.length - 1) {
-                            if (data[i].node != data[i + 1].node) {
-                                _html += "</li>"
-                            }
-                        }
-                    }
-                    if (!_html) {
-                        _html = _self._localeStr.WEB_NOAPPROVALRECORDS
-                    }
-                    $("#approveHisInfo ul")[0].innerHTML = _html
-                }
-            })
-        },
-        showbtn: function () {
-            waf("#dynamicSign").wafLinkButton("option", "hidden", !assign.dynamicSign);
-            waf("#appendActivity").wafLinkButton("option", "hidden", !assign.allowAppendActivity || approvetype == "manualdecision");
-            waf("#jumpto").wafLinkButton("option", "hidden", !assign.allowJumpTo);
-            waf("#kickback").wafLinkButton("option", "hidden", !assign.allowKickBack);
-            waf("#deliver").wafLinkButton("option", "hidden", !assign.allowDeliver);
-            waf("#YZJShare").wafLinkButton("option", "hidden", true);
-            if (assign.allowJumpTo || assign.allowKickBack) {
-                var assignId = assign.assignId;
-                waf.doPost({
-                    url: waf.getContextPath() + "/common/tree.do?method=getJumpAndKickBackModel",
-                    async: false,
-                    data: {
-                        assignId: assignId
-                    },
-                    success: function (data) {
-                        if (assign.allowJumpTo) {
-                            waf("#jumpto").wafLinkButton("option", "hidden", !data.jumpTo)
-                        }
-                        if (assign.allowKickBack) {
-                            waf("#kickback").wafLinkButton("option", "hidden", !data.kickBack)
-                        }
-                    }
-                })
-            }
-            if (assign.canSpecifyNextPerformer || assign.mustShowPostActivities || assign.showNextP) {
-                if (assign.mustShowPostActivities || assign.showNextP) {
-                    waf(nextActIndex).wafCheckbox("option", "checked", true)
-                }
-            } else {
-                waf(nextActIndex).wafCheckbox("option", "hidden", true)
-            }
-            if (approvetype != "batchapprove") {
-                waf("#btnImage").wafLinkButton("option", "hidden", false)
-            } else {
-                waf("#btnBill").wafLinkButton("option", "hidden", false)
-            }
-            if (approvetype == "approve") {
-                waf("#save").wafLinkButton("option", "hidden", false)
-            }
-        },
-        setselnextperson: function (actId, name, id) {
-            var ps = {};
-            if (selnextPersons[actId]) {
-                ps = selnextPersons[actId];
-                if (ps[id]) {
-                    return
-                }
-            }
-            ps[id] = {
-                number: "",
-                name: name,
-                id: id
-            };
-            selnextPersons[actId] = ps
-        },
-        loadNextActs: function () {
-            _private.getnextacts();
-            var nextActs = assign.nextActs;
-            _private.innerloadNextActs(nextActs)
-        },
-        innerloadNextActs: function (nextActs, selectAct) {
-            var table = $("#nextActList");
-            var _innerhtml = "";
-            if (nextActs) {
-                var actTitles = {};
-                if (nextActs.length == 0) {
-                    _innerhtml += "<div>" + _self._localeStr.WEB_NOSETACTIVITYPERSON + "</div>";
-                    $(_private.modifyNextAct).wafLinkButton("option", "hidden", true)
-                } else {
-                    var hasAct = false;
-                    var selectActobj = {};
-                    if (selectAct) {
-                        for (var actid in selectAct) {
-                            selectActobj[actid] = actid
-                        }
-                    }
-                    for (var i = 0; i != nextActs.length; i++) {
-                        var act = nextActs[i];
-                        var num = 0;
-                        var actId = act.actId;
-                        var candidateselected = act.candidateselected;
-                        if (!selectActobj[actId]) {
-                            for (var id in candidateselected) {
-                                _private.setselnextperson(actId, candidateselected[id], id);
-                                num++
-                            }
-                        }
-                        if (_private.isPredict && !act.isPredict) {
-                            continue
-                        }
-                        hasAct = true;
-                        var actKey = act.actKey;
-                        var actName = act.actName;
-                        var isAllPersonAsPerformer = act.isAllPersonAsPerformer;
-                        var persons = act.persons;
-                        var count = act.count;
-                        var issel = false;
-                        var title = "";
-                        if (num > 0) {
-                            issel = true
-                        }
-                        _innerhtml += "<div class='actInfo' actId='" + actId + "' actKey='" + actKey + "' title='" + actName + "'>" + actName + "</div><div class='actInfoperson' id='" + actId + "'>";
-                        if (issel) {
-                            _innerhtml += _self._localeStr.WEB_SELECTED;
-                            var j = 0;
-                            for (var id in candidateselected) {
-                                if (j > 0) {
-                                    title += "、"
-                                }
-                                title += candidateselected[id];
-                                if (j > 2) {
-                                    j++;
-                                    continue
-                                }
-                                if (j > 0) {
-                                    _innerhtml += "、"
-                                }
-                                _innerhtml += "<span class='persons' personid='" + id + "'>" + candidateselected[id] + "</span>";
-                                j++
-                            }
-                            actTitles[actId] = title;
-                            if (j > 2) {
-                                _innerhtml += _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
-                            }
-                        } else {
-                            if (count > 0) {
-                                _innerhtml += "";
-                                var j = 0;
-                                for (var id in persons) {
-                                    if (j > 0) {
-                                        title += "、"
-                                    }
-                                    title += persons[id];
-                                    if (j > 2) {
-                                        _innerhtml += _self._localeStr.WEB_ANDSOON + count + _self._localeStr.WEB_PEOPLE;
-                                        break
-                                    }
-                                    if (j > 0) {
-                                        _innerhtml += "、"
-                                    }
-                                    _innerhtml += "<span class='persons' personid='" + id + "'>" + persons[id] + "</span>";
-                                    j++
-                                }
-                                actTitles[actId] = title
-                            } else {
-                                _innerhtml += _self._localeStr.WEB_UNSELECTEDPERSON
-                            }
-                        }
-                        _innerhtml += "</div>"
-                    }
-                    if (!hasAct) {
-                        _innerhtml += "<div>" + _self._localeStr.WEB_POINTNEXTTIP + "</div>"
-                    }
-                    $(_private.modifyNextAct).wafLinkButton("option", "hidden", false)
-                }
-                table.html(_innerhtml);
-                for (var actTitle in actTitles) {
-                    $("#" + actTitle).attr("title", actTitles[actTitle])
-                }
-            }
-        },
-        getOpinion: function (actInstId, assignId, billId) {
-            var params = {};
-            params.actInstId = actInstId;
-            params.assignId = assignId;
-            params.billId = billId;
-            params.type = approvetype;
-            waf.doPost({
-                url: waf.getContextPath() + "/workflow/approve.do?method=getOpinion",
-                data: params,
-                success: function (data) {
-                    if (data != null && data != "" && data.option != null && data.option != "") {
-                        $("#approveOpinionInfo span").text(data.option)
-                    } else {
-                        $("#approveOpinionInfo").hide()
-                    }
-                }
-            })
-        },
-        supportMulti: function () {
-            $("#approveDeliverBtn span").text(_self._localeStr.WEB_DELIVER);
-            $("#approvePassBtn span").text(_self._localeStr.WEB_CIRCULATEBTN);
-            $("#approveAppendBtn span").text(_self._localeStr.WEB_ADDSIGN);
-            $("#approveDynamicSignBtn span").text(_self._localeStr.WEB_CONTERSIGNED);
-            $("#approveSaveBtn span").text(_self._localeStr.WEB_SAVE);
-            $("#approveSubmitBtn span").text(_self._localeStr.WEB_SUBMIT);
-            $("#btnUpload").prepend(_self._localeStr.WEB_UPLOADATTACH);
-            $("#attachmul1").prepend(_self._localeStr.WEB_ATTCHNUM);
-            $("#attchmul2").prepend(_self._localeStr.WEB_VIEWDETAIL);
-            $("#attachmul3").prepend(_self._localeStr.WEB_ATTCHGE);
-            $("#attchment").append($(".attchmentnuminfo"));
-            $("#attchment").append($("#upload"));
-            $("#myPhraseInfo .edit").text(_self._localeStr.WEB_SAVE);
-            $("#myPhraseInfo .backprevious").text(_self._localeStr.WEB_BACK);
-            $("#myPhraseInfo .commit").text(_self._localeStr.WEB_DETERMINE);
-            $("#myPhrasetext").prop("placeholder", _self._localeStr.WEB_ENTER_COMMENTS)
-        },
-        initApprove: function () {
-            if (assign.riskInsight) {
-                _private.initRiskInsight()
-            } else {
-                waf("#riskInsight").wafTab("remove")
-            }
-            _private.initEsignature();
-            _private.initCCPerson();
-            _private.showbtn();
-            _private.initBillPage();
-            _private.initAttachment();
-            _private.initOperateIframe();
-            _private.initAbstractAndPhrase();
-            _private.initApprovePolicy()
-        },
-        initBatchapprove: function () {
-            _private.initEsignature();
-            _private.showbtn();
-            locationurl.billIds = decodeURIComponent(parent.window.billIDs);
-            locationurl.assignmentIds = parent.window.assignmentIDs;
-            _private.getbatchlist();
-            _private.initAbstractAndPhrase();
-            _private.initApprovePolicy();
-            waf("#attchment").wafSection("option", "hidden", true);
-            $("#upload").remove();
-            $("#operateInfo").remove();
-            $(".attchmentnuminfo").remove()
-        },
-        initManualdecision: function () {
-            _private.initManualdecisionNextAct();
-            _private.showbtn();
-            _private.initBillPage();
-            _private.initAttachment();
-            _private.initOperateIframe();
-            _private.initDecisionDescAndVal()
-        },
-        initPassComent: function () {
-            if (assign.passcoment != null) {
-                waf("#passComentOpinion").val(assign.passcoment)
-            }
-            if (assign.isFeedBack) {
-                waf("#sendmsgs").wafCheckbox("disable");
-                waf("#sendmails").wafCheckbox("disable")
-            }
-            waf("#submit").wafLinkButton("option", "hidden", assign.isFeedBack);
-            waf("#passAssignment").wafLinkButton("option", "hidden", (assign.againPass === "false"));
-            _private.initBillPage();
-            _private.initAttachment();
-            _private.initOperateIframe()
-        },
-        initManualdecisionNextAct: function () {
-            nextActIndex = "#nextAct1";
-            _private.modifyNextAct = "#modifynextAct1";
-            if (waf(nextActIndex).wafCheckbox("isChecked")) {
-                _private.loadNextActs()
-            }
-        },
-        initRiskInsight: function () {
-            try {
-                mod.use("billInsight", function () {
-                    riskInsight = true;
-                    $("#form").append('<div id="billInsight" class="" ctrlrole="waf.billInsight" data-domcreated="true"></div>');
-                    $("#li_approveTask").css("width", "50%");
-                    $("#li_riskInsight").show();
-                    billInsightOption = _private.getWeakRisk();
-                    _private.updateBillInsightNum(billInsightOption);
-                    $(window).resize(function () {
-                        _private.resizeBillInsight(true)
-                    })
-                })
-            } catch (e) {
-                console.log(_self._localeStr.WEB_CONSOLETEXT)
-            }
-        },
-        initCCPerson: function () {
-            if (assign.allowCC) {
-                $("#panelCC").show()
-            }
-            if (assign.ccPersonIds != null && assign.ccPersonName != null) {
-                waf("#textCC").prop("personIds", assign.ccPersonIds);
-                waf("#textCC").val(assign.ccPersonName)
-            }
-        },
-        initEsignature: function () {
-            if (!assign.isEsignature || assign.esignatureAttachId == undefined || assign.esignatureAttachId == "") {
-                $("#panel6").remove()
-            } else {
-                var _html = "<img src='/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=" + assign.esignatureAttachId + "'/>";
-                $("#esigndiv")[0].innerHTML = _html
-            }
-        },
-        initBillPage: function () {
-            if (assign.messageDigest) {
-                try {
-                    _private.messageDigest()
-                } catch (e) {
-                    console.log(_self._localeStr.WEB_BILLINITFAILED)
-                }
-            } else {
-                if (!assign.billEditUrl || assign.billEditUrl == "nobill.html") {
-                    assign.billEditUrl = "/easweb/webviews/workflow/nobill.html?"
-                }
-                if (approvetype == "passComent" && msgId) {
-                    assign.billEditUrl = assign.billEditUrl + "&msgId=" + encodeURIComponent(msgId)
-                }
-                _private.displayBillInfo(assign.billEditUrl)
-            }
-        },
-        initAttachment: function () {
-            waf("#attachmentBtn").wafLinkButton("option", "hidden", assign.attachDisabled);
-            _private.refreshAttachCountInner(assign.attachmentCount)
-        },
-        initOperateIframe: function () {
-            var url = "/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.approveRelatedInfo&isshowapprove=true&assignmentId=" + assign.assignId;
-            waf("#operateiframe").wafIframe("option", "src", url)
-        },
-        initApprovePolicy: function () {
-            _private.getPolicy(assign.approveValue);
-            _private.getDefaultOption();
-            if (assign.id) {
-                waf("#approveResult").wafRadioGroup("setValue", assign.approveResult);
-                waf("#policy").wafSelect("setValue", assign.handlerOpinion)
-            } else {
-                waf("#approveResult").wafRadioGroup("setValue", "true")
-            }
-        },
-        initAbstractAndPhrase: function () {
-            if (assign.absStr) {
-                waf("#optionalSection").wafSection("option", "title", _self._localeStr.WEB_PROCESSSUMMARY);
-                waf("#optionalSection").wafSection("option", "hidden", false);
-                $("#description").text(assign.absStr)
-            }
-            _private.getphrase();
-            $("#myPhraseList").on("click", "li", function (e) {
-                _private.clickPhrase(e)
-            });
-            $("#myPhraseList").on("dblclick", "li", function (e) {
-                _private.dblclickPhrase(e)
-            });
-            $("#myPhraseList").on("click", "li i", function (e) {
-                _private.phrasedel(e)
-            })
-        },
-        initDecisionDescAndVal: function () {
-            if (assign.decisionDesc) {
-                waf("#optionalSection").wafSection("option", "title", _self._localeStr.WEB_DECISONDESC);
-                waf("#optionalSection").wafSection("option", "hidden", false);
-                $("#description").text(assign.decisionDesc);
-                _private.changeBillHeight(85, false)
-            }
-            _private.setmanualdecision()
-        },
-        initCalProcDiagram: function () {
-            var url = "/easweb/webviews/workflow/calProcDiagramNew.jsp?procInstId=" + assign.procInstId + "&actinstId=" + assign.actInstId + "&newPage=" + assign.newPage;
-            waf("#" + _private.charFrameId).wafIframe("option", "src", url);
-            var urlWin = "/easweb/webviews/workflow/calProcDiagram.jsp?procInstId=" + assign.procInstId + "&actinstId=" + assign.actInstId;
-            waf("#chartIframe").wafIframe("option", "src", urlWin);
-            $("#chart").click(function () {
-                $("#chart").hide()
-            });
-            $("#chartClose").click(function () {
-                $("#chart").hide()
-            });
-            $("#openChartIframe").click(function () {
-                $("#chart").show()
-            });
-            var times = 0;
-            var interval = setInterval(function () {
-                if (window.frames[_private.charFrameId]) {
-                    var num = window.frames[_private.charFrameId].num;
-                    if (num > 0) {
-                        var iWidth = window.innerWidth * (4 / 5);
-                        var rowNum = parseInt(iWidth / 176);
-                        var calcHeight = Math.ceil(num / rowNum) * 140;
-                        var winHeight = "";
-                        if (top == parent.parent) {
-                            winHeight = window.innerHeight
-                        } else {
-                            winHeight = window.screen.availHeight - 120
-                        }
-                        var iHeight = winHeight * (4 / 5);
-                        if (calcHeight < iHeight) {
-                            iHeight = calcHeight
-                        }
-                        var iTop = (winHeight - 70 - iHeight) / 2;
-                        var iLeft = (window.innerWidth - 10 - iWidth) / 2;
-                        $("#chartIframe").css({
-                            "margin-left": iLeft,
-                            "margin-top": iTop,
-                            width: iWidth,
-                            height: iHeight
-                        })
-                    }
-                }
-                times++;
-                if (times > 100) {
-                    clearInterval(interval)
-                }
-            }, 100)
-        },
-        initPageLayout: function () {
-            if (assign.newPage) {
-                $("#predictionChart").remove();
-                _private.charFrameId = "predictionChartIframeNew";
-                _private.initBtnNew()
-            } else {
-                $("#predictionChartNew").remove()
-            }
-            if (locationurl.isOpenNewTab != undefined && locationurl.isOpenNewTab == "true") {
-                $("#nextActList").css("height", "25vh")
-            }
-        },
-        initCalProcDiagramPanel: function () {
-            if (approvetype == "approve") {
-                _private.initCalProcDiagram()
-            } else {
-                $("#chart").remove();
-                $("#predictionChart").remove();
-                $("#predictionChartNew").remove()
-            }
-        },
-        initSection: function () {
-            if (approvetype != "batchapprove") {
-                waf("#predictionChart").wafSection("option", "onopen", function (event) {
-                    _private.changeBillHeight(50, false)
-                });
-                waf("#predictionChart").wafSection("option", "onclose", function (event) {
-                    _private.changeBillHeight(50, true)
-                });
-                waf("#operateInfo").wafSection("option", "onopen", function (event) {
-                    _private.changeBillHeight(220, false)
-                });
-                waf("#operateInfo").wafSection("option", "onclose", function (event) {
-                    _private.changeBillHeight(220, true)
-                });
-                waf("#optionalSection").wafSection("option", "onopen", function (event) {
-                    _private.changeBillHeight(60, false)
-                });
-                waf("#optionalSection").wafSection("option", "onclose", function (event) {
-                    _private.changeBillHeight(60, true)
-                })
-            }
-        },
-        initZoomTool: function () {
-            $("#onClose").show();
-            $("#tabs_ul li").eq($("#tabs_ul li").length - 1).append($("#onClose"));
-            $("#splitPanel_LeftSplitPanel").prepend($("#onOpen"));
-            $("#onClose").bind("click", function () {
-                $("#splitPanel").height($("#splitPanel_LeftSplitPanel").height());
-                rightPanelWidth = $("#splitPanel_RightSplitPanel").width();
-                leftPanelWidth = $("#splitPanel_LeftSplitPanel").width();
-                $("#splitPanel_RightSplitPanel").css("width", "0%");
-                $("#splitPanel_LeftSplitPanel").css("width", "100%");
-                $("#onOpen").show();
-                if (riskInsight && _private.curTab == "riskInsight") {
-                    $(".billInsight_cardPanel").css("display", "none")
-                }
-                if (approvetype == "batchapprove" && !assign.batchApproveUrl) {
-                    var newWidth = $("#queryGrid").wafGrid("getGridParentWidth");
-                    $("#queryGrid").jqGrid("setGridWidth", newWidth)
-                }
-            });
-            $("#onOpen").bind("click", function () {
-                $("#onOpen").hide();
-                $("#splitPanel_RightSplitPanel").css("width", rightPanelWidth);
-                $("#splitPanel_LeftSplitPanel").css("width", leftPanelWidth);
-                if (riskInsight && _private.curTab == "riskInsight") {
-                    $(".billInsight_cardPanel").show()
-                }
-                if (approvetype == "batchapprove" && !assign.batchApproveUrl) {
-                    var newWidth = $("#queryGrid").wafGrid("getGridParentWidth");
-                    $("#queryGrid").jqGrid("setGridWidth", newWidth)
-                }
-            });
-            $("#onOpen").bind("hover", function () {
-                $("#onOpen").css("opacity", 1)
-            })
-        },
-        pageOnload: function (e) {
-            _private.supportMulti();
-            _private.showtab();
-            var billId = assign.billId;
-            if (approvetype == "approve") {
-                _private.initApprove()
-            } else {
-                if (approvetype == "batchapprove") {
-                    _private.initBatchapprove()
-                } else {
-                    if (approvetype == "manualdecision") {
-                        _private.initManualdecision()
-                    } else {
-                        if (approvetype == "passComent") {
-                            _private.initPassComent();
-                            billId = passId
-                        }
-                    }
-                }
-            }
-            _private.initSection();
-            _private.initPageLayout();
-            _private.initCalProcDiagramPanel();
-            _private.getOpinion(assign.actInstId, assign.assignId, billId);
-            _private.setsendmailormsg(assign.isOpenMessageSendOnUI, assign.notifyNextBySMS, assign.notifyNextByMail);
-            if (assign.newPage) {
-                _private.initZoomTool()
-            }
-            _private.resizePage();
-            window.scrollTo(0, 0);
-            var newTab = waf.getUrlParams(document.URL).isOpenNewTab;
-            if (newTab) {
-                $("#operateInfo").css("margin", "3px 5px 5px 0")
-            }
-        },
-        initBtnNew: function () {
-            var submitBtn = waf("#submit").wafLinkButton("option", "hidden");
-            $("#toolBar .ui-toolbar-ul").css("float", "right");
-            if (approvetype == "approve" || approvetype == "batchapprove") {
-                if (approvetype == "approve") {
-                    var offset = $("#panelNew1").width() - ($("#approveSaveBtn").width() * 2 + 20);
-                    if (offset > 0) {
-                        $("#approveSaveBtn").css("margin-left", offset / 2)
-                    }
-                } else {
-                    $("#approveSubmitBtn").css("float", "right")
-                }
-                $("#toolBarNew1").show();
-                $("#panelNew1").show();
-                $("#labelapproveResult_label").hide();
-                waf("#approveSubmitBtn").wafLinkButton("option", "hidden", submitBtn);
-                waf("#approveSaveBtn").wafLinkButton("option", "hidden", waf("#save").wafLinkButton("option", "hidden"));
-                waf("#approveDeliverBtn").wafLinkButton("option", "hidden", waf("#deliver").wafLinkButton("option", "hidden"));
-                waf("#approvePassBtn").wafLinkButton("option", "hidden", waf("#passAssignment").wafLinkButton("option", "hidden"));
-                waf("#approveKickbackBtn").wafLinkButton("option", "hidden", waf("#kickback").wafLinkButton("option", "hidden"));
-                waf("#approveAppendBtn").wafLinkButton("option", "hidden", waf("#appendActivity").wafLinkButton("option", "hidden"));
-                waf("#approveDynamicSignBtn").wafLinkButton("option", "hidden", waf("#dynamicSign").wafLinkButton("option", "hidden"));
-                waf("#approveJumpBtn").wafLinkButton("option", "hidden", waf("#jumpto").wafLinkButton("option", "hidden"))
-            } else {
-                if (approvetype == "manualdecision") {
-                    $("#panelNew3").show();
-                    var b = waf("#deliver").wafLinkButton("option", "hidden");
-                    if (!b) {
-                        $("#toolBarNew3").show()
-                    }
-                    waf("#decisionDeliverBtn").wafLinkButton("option", "hidden", waf("#deliver").wafLinkButton("option", "hidden"));
-                    waf("#decisionSubmitBtn").wafLinkButton("option", "hidden", submitBtn)
-                } else {
-                    if (approvetype == "passComent") {
-                        $("#panelNew2").show();
-                        var b = waf("#passAssignment").wafLinkButton("option", "hidden");
-                        if (!b) {
-                            $("#toolBarNew2").show()
-                        }
-                        waf("#passPassBtn").wafLinkButton("option", "hidden", b);
-                        waf("#passSubmitBtn").wafLinkButton("option", "hidden", submitBtn)
-                    }
-                }
-            }
-            waf("#submit").wafLinkButton("option", "hidden", true);
-            waf("#save").wafLinkButton("option", "hidden", true);
-            waf("#deliver").wafLinkButton("option", "hidden", true);
-            waf("#passAssignment").wafLinkButton("option", "hidden", true);
-            waf("#kickback").wafLinkButton("option", "hidden", true);
-            waf("#appendActivity").wafLinkButton("option", "hidden", true);
-            waf("#dynamicSign").wafLinkButton("option", "hidden", true);
-            waf("#jumpto").wafLinkButton("option", "hidden", true);
-            if (approvetype != "batchapprove") {
-                $("#assignTitle").show();
-                $("#assignTitle").css("width", $("#toolBar").width() - $("#toolBar .ui-toolbar-ul").width());
-                $("#assignTitle").text(assign.title);
-                $("#assignTitle").prop("title", assign.title)
-            }
-        },
-        changePolicy: function (event, ui) {
-            _private.setPolicy(ui.current);
-            if (ui.current == "false") {
-                $("#panel").hide()
-            } else {
-                $("#panel").show()
-            }
-        },
-        deliver: function (event, value) {
-            var para = {};
-            if (approvetype == "batchapprove") {
-                para.sourceID = _private.getbatchid().assignIds
-            } else {
-                para.sourceID = assign.assignId
-            }
-            wfCommonUtil.deliverAssignment(para)
-        },
-        passAssignment: function (event, value) {
-            var para = {};
-            if (approvetype == "batchapprove") {
-                var info = _private.getbatchid();
-                para.sourceID = info.assignIds;
-                para.bizObjID = info.billIds
-            } else {
-                para.sourceID = assign.assignId;
-                para.bizObjID = assign.billId
-            }
-            wfCommonUtil.passComment(para)
-        },
-        kickback: function (event, value) {
-            var assignid = "";
-            if (approvetype == "batchapprove") {
-                assignid = _private.getbatchid().assignIds
-            } else {
-                assignid = assign.assignId
-            }
-            var url = waf.getContextPath() + "/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.kickBackPage&assignmentId=" + encodeURIComponent(assignid);
-            wfCommonUtil.windowopen(url, _self._localeStr.WEB_REJECT, 450, 320)
-        },
-        jumpto: function (event, value) {
-            var assignid = "";
-            if (approvetype == "batchapprove") {
-                assignid = _private.getbatchid().assignIds
-            } else {
-                assignid = assign.assignId
-            }
-            var url = waf.getContextPath() + "/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.jump&assignmentId=" + encodeURIComponent(assignid);
-            wfCommonUtil.windowopen(url, _self._localeStr.WEB_JUMP, 450, 281)
-        },
-        dynamicSign: function (event, value) {
-            var assignid = "";
-            if (approvetype == "batchapprove") {
-                assignid = _private.getbatchid().assignIds
-            } else {
-                assignid = assign.assignId
-            }
-            var url = waf.getContextPath() + "/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.dynamicSignPage&assignmentId=" + encodeURIComponent(assignid);
-            wfCommonUtil.windowopen(url, _self._localeStr.WEB_COUNTERSIGNPART, 450, 281)
-        },
-        appendActivity: function (event, value) {
-            var billId = "";
-            var assignId = "";
-            if (approvetype == "batchapprove") {
-                var info = _private.getbatchid();
-                assignId = info.assignIds;
-                billId = info.billIds
-            } else {
-                assignId = assign.assignId;
-                billId = assign.billId
-            }
-            var url = waf.getContextPath() + "/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.appendSignPage&assignmentId=" + encodeURIComponent(assignId) + "&billIds=" + encodeURIComponent(billId) + "&isAppended=" + assign.isAppended;
-            if (assign.appendMode) {
-                url += "&appendMode=" + assign.appendMode[0]
-            }
-            if (assign.routeMode) {
-                url += "&routeMode=" + assign.routeMode[0]
-            }
-            wfCommonUtil.windowopen(url, _self._localeStr.WEB_COUNTERSIGN, 520, 746)
-        },
-        modifynextAct: function (event, value) {
-            _private.setmodifynextAct()
-        },
-        setselnextactperson: function (resultStr) {
-            _private.innerloadNextActs(assign.nextActs, resultStr);
-            for (var actid in resultStr) {
-                var ps = resultStr[actid];
-                var _innerhtml = _self._localeStr.WEB_SELECTED;
-                var j = 0;
-                if (_private.isEmptyObject(ps)) {
-                    delete selnextPersons[actid]
-                } else {
-                    var title = "";
-                    for (var id in ps) {
-                        var person = ps[id];
-                        var name = person.name;
-                        _private.setselnextperson(actid, name, id);
-                        if (j > 0) {
-                            title += "、"
-                        }
-                        title += name;
-                        if (j > 2) {
-                            j++;
-                            continue
-                        }
-                        if (j > 0) {
-                            _innerhtml += "、"
-                        }
-                        _innerhtml += "<span class='persons' personid='" + id + "'>" + name + "</span>";
-                        j++
-                    }
-                    if (j > 2) {
-                        _innerhtml += _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
-                    }
-                    $("#" + actid).html(_innerhtml);
-                    $("#" + actid).attr("title", title)
-                }
-            }
-        },
-        isEmptyObject: function (obj) {
-            for (var key in obj) {
-                return false
-            }
-            return true
-        },
-        getphrase: function () {
-            waf.doPost({
-                url: waf.getContextPath() + "/workflow/approve.do?method=getAppMyPhraseList",
-                success: function (data) {
-                    var myPhraseList = $("#myPhraseList .showdel");
-                    myPhraseList.html("");
-                    for (var i = 0; i < data.length; i++) {
-                        var row = $("<li></li>");
-                        row.attr({
-                            "data-id": data[i].id,
-                            title: data[i].phraseText
-                        });
-                        row.text(data[i].phraseText);
-                        row.append("<i></i>");
-                        myPhraseList.append(row)
-                    }
-                }
-            })
-        },
-        clickPhrase: function (e) {
-            $("#myPhraseInfo li").removeClass("cur");
-            var targetElem = $(e.target);
-            targetElem.addClass("cur");
-            $("#myPhrasetext").val(targetElem.attr("title"));
-            $("#myPhrasetext").attr("data-id", targetElem.attr("data-id"))
-        },
-        dblclickPhrase: function (e) {
-            var itemval = $(e.target).attr("title");
-            $("#approveOpinion").val(itemval);
-            $("#myPhraseInfo li").removeClass("cur");
-            $("#myPhrasetext").attr("data-id", "");
-            $("#myPhrasetext").val("");
-            $("#phrasePanel").hide()
-        },
-        phrasesure: function (e) {
-            var text = $("#myPhrasetext").val();
-            if (text != null && text.length > 1000) {
-                _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG);
-                return null
-            }
-            $("#approveOpinion").val(text);
-            $("#myPhraseInfo li").removeClass("cur");
-            $("#myPhrasetext").attr("data-id", "");
-            $("#myPhrasetext").val("");
-            $("#phrasePanel").hide()
-        },
-        phraseback: function (e) {
-            $("#myPhraseInfo li").removeClass("cur");
-            $("#myPhrasetext").attr("data-id", "");
-            $("#myPhrasetext").val("");
-            $("#phrasePanel").hide()
-        },
-        myPhrase: function (event, value) {
-            $("#phrasePanel").show();
-            $("#myPhrasesection .ui-jqgrid-bdiv").css("height", "auto")
-        },
-        addphrase: function () {
-            var text = $("#myPhrasetext").val();
-            if (text != null && text.length > 1000) {
-                _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG);
-                return null
-            }
-            var param = {};
-            var rowid = $("#myPhrasetext").attr("data-id");
-            var value = $("#myPhrasetext").val();
-            if (!value) {
-                return
-            }
-            if (rowid) {
-                param.method = "updateOption";
-                param.opId = rowid;
-                param.opName = value
-            } else {
-                param.phraseTxt = value;
-                param.method = "saveMyPhrase"
-            }
-            waf.doPost({
-                url: waf.getContextPath() + "/workflow/approve.do",
-                data: param,
-                success: function (data) {
-                    _private.getphrase();
-                    _self.showSuccess(_self._localeStr.WEB_ADDCOMMONCOMMENTS)
-                }
-            })
-        },
-        phrasedel: function (e) {
-            var param = {};
-            param.phraseIds = $(e.target).parent().attr("data-id");
-            $("#myPhrasetext").attr("data-id", "");
-            $("#myPhrasetext").val("");
-            waf.doPost({
-                url: waf.getContextPath() + "/workflow/approve.do?method=delMyPhrase",
-                data: param,
-                success: function (data) {
-                    _private.getphrase();
-                    _self.showSuccess(_self._localeStr.WEB_DELETECOMMONCOMMENTS)
-                }
-            })
-        },
-        pageOnRenderBefore: function (e) {
-            assign = _self.getPageInitData();
-            if (approvetype != "passComent") {
-                _private.initCAConfig(assign.CAConfig)
-            }
-            var title = "";
-            if (approvetype == "batchapprove") {
-                title = _self._localeStr.WEB_BATCHAPPROVAL
-            } else {
-                title = assign.title
-            }
-            _self.changeTitle(title)
-        },
-        phraseadd: function (e) {
-            var datarow = {
-                phraseText: ""
-            };
-            waf("#myPhrasegrid").wafGrid("addRow", {
-                data: datarow
-            })
-        },
-        viewProcessDiagram: function (event, value) {
-            var para = {};
-            if (approvetype == "batchapprove") {
-                var assignIds = _private.getbatchid().assignIds;
-                if (assignIds.split(";").length != 1) {
-                    _self.showInfo(_self._localeStr.WEB_SELECTARECORD);
-                    return false
-                }
-                para.sourceID = assignIds.split(";")[0]
-            } else {
-                para.sourceID = assign.assignId
-            }
-            wfCommonUtil.viewProcessDiagram(para)
-        },
-        reloadTranId: function () {
-            var approveResult = waf("#approveResult").wafRadioGroup("getValue");
-            var policy = waf("#policy").wafSelect("getValue");
-            var ispass;
-            if (approveResult == "false") {
-                ispass = false
-            } else {
-                if (approveResult == "true") {
-                    ispass = true
-                }
-            }
-            if (assign) {
-                var approveValueStr = assign.approveValue;
-                if (approveValueStr == null || approveValueStr == "") {
-                    approveValueStr = "0;" + _self._localeStr.WEB_AGREE + ";" + _self._localeStr.WEB_AGREE + ";:1;" + _self._localeStr.WEB_DISAGREE + ";" + _self._localeStr.WEB_DISAGREE + ";"
-                }
-                var strs = approveValueStr.split(":");
-                for (var i = 0; i < strs.length; i++) {
-                    var strTemp = strs[i].split(";");
-                    if (strTemp.length != 4) {
-                        continue
-                    }
-                    if (ispass && policy == strTemp[0]) {
-                        transId = strTemp[3];
-                        return
-                    }
-                }
-            }
-        },
-        changeselPolicy: function (event, ui) {
-            _private.reloadTranId();
-            if (waf(nextActIndex).wafCheckbox("isChecked")) {
-                _private.loadNextActs()
-            }
-        },
-        getnextacts: function () {
-            var param = {};
-            param.assignId = assign.assignId;
-            param.associatedLine = transId;
-            param.isPredict = _private.isPredict;
-            param.isNewProcessCenter = true;
-            waf.doPost({
-                url: waf.getContextPath() + "/common/tree.do?method=findPostParticipants",
-                data: param,
-                async: false,
-                success: function (data) {
-                    assign.nextActs = data
-                }
-            })
-        },
-        showtab: function () {
-            if (approvetype == "approve" || approvetype == "batchapprove") {
-                $("#tabs").wafTabs("remove", "#manualdecision");
-                $("#tabs").wafTabs("remove", "#passComent")
-            } else {
-                if (approvetype == "manualdecision") {
-                    $("#tabs").wafTabs("remove", "#approveTask");
-                    $("#tabs").wafTabs("remove", "#passComent")
-                } else {
-                    if (approvetype == "passComent") {
-                        $("#tabs").wafTabs("remove", "#approveTask");
-                        $("#tabs").wafTabs("remove", "#manualdecision")
-                    }
-                }
-            }
-            if (approvetype != "approve") {
-                waf("#riskInsight").wafTab("remove")
-            }
-        },
-        setmanualdecision: function () {
-            var items = assign.decisionItems;
-            var opinions = assign.decisionOpinions;
-            var _html = "";
-            var itemArr = items.split(";");
-            var opinionArr = new Array();
-            if (!opinions) {
-                var opinionItem = "";
-                for (var i = 0; i < itemArr.length; i++) {
-                    opinionItem += (i + 1);
-                    if (i < itemArr.length - 1) {
-                        opinionItem += ";"
-                    }
-                    opinionArr.push(i + 1)
-                }
-                assign.decisionOpinions = opinionItem
-            } else {
-                opinionArr = opinions.split(";")
-            }
-            var json = [];
-            for (var i = 0; i < itemArr.length; i++) {
-                var name = itemArr[i];
-                var val = opinionArr[i];
-                var para = {};
-                para.value = val + "_" + i;
-                para.alias = name;
-                json.push(para)
-            }
-            waf("#radioDecision").wafRadioGroup("setItems", null, json);
-            waf("#radioDecision").wafRadioGroup("setValue", json[0].value)
-        },
-        nextActs: function (event, ui) {
-            _private.shownextActs("modifynextAct1", ui)
-        },
-        nextAct: function (event, ui) {
-            _private.shownextActs("modifynextAct", ui)
-        },
-        modifynextActs: function (event, value) {
-            _private.setmodifynextAct()
-        },
-        setmodifynextAct: function () {
-            var jsonval = "";
-            if (selnextPersons == null || selnextPersons.length == 0) {
-                jsonval = ""
-            } else {
-                jsonval = JSON.stringify(selnextPersons)
-            }
-            waf.window.open({
-                url: waf.getContextPath() + "/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.setNextAct&debug=true&assignmentId=" + encodeURIComponent(assign.assignId) + "&selnextPersons=" + encodeURIComponent(jsonval) + "&asso=" + transId + "&isPredict=" + _private.isPredict,
-                openType: "iframe",
-                method: "POST",
-                data: {},
-                modal: true,
-                title: _self._localeStr.WEB_NEXTACTIVITY,
-                position: "center",
-                width: 1020,
-                height: 580,
-                minHeight: 560,
-                minWidth: 1020,
-                iconCls: "waf-ui-icon",
-                draggable: true,
-                resizable: true,
-                close: function (event, ui) { },
-                retValCallBack: function (resultData) {
-                    if (resultData && resultData.resultStr && resultData.resultStr.length > 0) {
-                        var resultStr = JSON.parse(resultData.resultStr);
-                        selnextPersons = {};
-                        _private.isPredict = resultData.isPredict;
-                        _private.setselnextactperson(resultStr)
-                    }
-                }
-            })
-        },
-        getbatchlist: function () {
-            if (assign.batchApproveUrl) {
-                var url = waf.getContextPath() + assign.batchApproveUrl + "&hasToolbar=false&showCommonQuery=false";
-                var billIds = locationurl.billIds.split(";");
-                var temp = "id%20in%20(";
-                for (var i = 0; i < billIds.length; i++) {
-                    if (billIds[i]) {
-                        if (i == 0) {
-                            temp += "%27" + encodeURIComponent(billIds[i]) + "%27"
-                        } else {
-                            temp += "%2C%27" + encodeURIComponent(billIds[i]) + "%27"
-                        }
-                    }
-                }
-                temp += ")";
-                $("<form id='framesrcbillform' method='POST' type='hidden' target='billFrame' action='" + url + "'></form>").insertAfter($("#billFrame")).append($("<input type='hidden' name='filterInfo' value='" + temp + "'>")).append($("<input type='hidden' name='botpFilter' value='" + temp + "'>"));
-                setTimeout(function () {
-                    document.getElementById("framesrcbillform").submit()
-                }, 500);
-                var times = 0;
-                var interval = setInterval(function () {
-                    var frame = document.getElementById("billFrame");
-                    $($(frame)[0].contentDocument.body).find(".ui-jqgrid").css({
-                        margin: "0px",
-                        width: "100%"
-                    });
-                    if (times > 600) {
-                        clearInterval(interval)
-                    }
-                    times++
-                })
-            } else {
-                waf("#billFrame").remove();
-                var listinfo = {};
-                waf.doPost({
-                    url: waf.getContextPath() + "/workflow/approve.do?method=getBatchApproveBillGrid",
-                    data: {
-                        billIds: locationurl.billIds
-                    },
-                    async: false,
-                    success: function (data) {
-                        listinfo = data
-                    }
-                });
-                var headers = listinfo.headers;
-                var list = listinfo.list;
-                var fields = listinfo.fields;
-                if (headers.length > 0) {
-                    var colmodel = [];
-                    var paraid = {
-                        name: "id",
-                        label: "id",
-                        hidden: true,
-                        key: true
-                    };
-                    colmodel.push(paraid);
-                    for (var m = 0; m < headers.length; m++) {
-                        var para = {
-                            name: fields[m],
-                            label: headers[m]
-                        };
-                        colmodel.push(para)
-                    }
-                    var myGridoptions = {
-                        id: "queryGrid",
-                        colModel: colmodel,
-                        multiselect: true,
-                        loadInit: false,
-                        shrinkToFit: true
-                    };
-                    if (headers.length > 15) {
-                        myGridoptions.shrinkToFit = false
-                    }
-                    var dom = waf.createDOM("grid", myGridoptions);
-                    waf.appendDOM(waf("#panel5"), dom);
-                    waf.initComponent("grid", myGridoptions, dom);
-                    for (var i = 0; i < list.length; i++) {
-                        for (var j in list[i]) {
-                            if (list[i][j] != null && typeof list[i][j] == "object") {
-                                list[i][j] = list[i][j].alias
-                            }
-                        }
-                        waf("#queryGrid").wafGrid("addRow", {
-                            data: list[i]
-                        })
-                    }
-                }
-            }
-        },
-        shownextActs: function (nextactname, ui) {
-            if (ui.checked) {
-                $(".approve-next-persons").show();
-                _private.loadNextActs()
-            } else {
-                $(".approve-next-persons").hide();
-                waf("#" + nextactname).wafLinkButton("option", "hidden", true);
-                selnextPersons = {}
-            }
-        },
-        submit: function (event, value) {
-            if (approvetype == "approve") {
-                _private.confirmSumit("beforeInnerSubmit")
-            } else {
-                if (approvetype == "manualdecision") {
-                    _private.manualdecisionsubmit()
-                } else {
-                    if (approvetype == "batchapprove") {
-                        _private.confirmSumit("batchSubmitForCA")
-                    } else {
-                        if (approvetype == "passComent") {
-                            _private.passComentsubmit()
-                        }
-                    }
-                }
-            }
-        },
-        confirmSumit: function (funcName) {
-            if (assign.enableMultiapproveConfirm == "true") {
-                var ok = function () {
-                    _private[funcName]()
-                };
-                var cancel = function () {
-                    return
-                };
-                waf.msgBox.showConfirm({
-                    title: _self._localeStr.WEB_MESSPROMPT,
-                    summaryMsg: _self._localeStr.WEB_CONFIRMSUBMITAPPROVAL,
-                    buttonType: "ok-cancel",
-                    buttonCallBack: [ok, cancel]
-                })
-            } else {
-                _private[funcName]()
-            }
-        },
-        passComentsubmit: function () {
-            var params = {};
-            params.parameter = sourceIDs;
-            params.chksendMessage = "yes";
-            if (waf("#sendmsgs").wafCheckbox("isChecked")) {
-                params.chksendMobile = "yes"
-            }
-            if (waf("#sendmails").wafCheckbox("isChecked")) {
-                params.chksendMail = "yes"
-            }
-            params.opinion = $("#passComentOpinion").val();
-            var option = $("#passComentOpinion").val();
-            if (option != null && option.length > 1000) {
-                _self.showInfo(_self._localeStr.WEB_FEEDBACKCOMMENTS_TOOLONG);
-                return null
-            }
-            waf.doPost({
-                url: waf.getContextPath() + "/passComment/get.do?method=commit",
-                data: params,
-                success: function (data) {
-                    _self.showSuccess(_self._localeStr.WEB_DEEDBACKCIRCULATESUCCESS);
-                    _private.backto()
-                }
-            })
-        },
-        initCAConfig: function (tCAConfig) {
-            caConfig.caConfigInfo = tCAConfig;
-            if (caConfig.caConfigInfo.isSignatureApprove === "true" && caConfig.caConfigInfo.caType != "5") {
-                var initflag = initTopesa();
-                if (initflag != 0) {
-                    waf.msgBox.showError(_self._localeStr.WEB_CAINITFAILED)
-                }
-            }
-        },
-        batchSubmitForCA: function () {
-            if (caConfig.caConfigInfo.checkPassword === "true" && caConfig.caConfigInfo.isSignatureApprove === "true" && caConfig.caConfigInfo.caType != "5") {
-                _private.checkCAPassword(true)
-            } else {
-                _private.batchSubmit()
-            }
-        },
-        checkCAPassword: function (isBatch) {
-            var setcss = function () {
-                var item = parent.$(".ui-msgbox .ui-prompt .prompt");
-                if ($(item)) {
-                    $(item).css({
-                        height: "78px",
-                        margin: "20px 0 20px 190px",
-                        background: "url(/easweb/webviews/workflow/img/waitpic.png) no-repeat"
-                    })
-                }
-            };
-            setTimeout(setcss, 100);
-            var prmt = function (r, dialog) {
-                if (r) {
-                    var res = -1;
-                    try {
-                        res = checkPassword(r, caConfig.caConfigInfo.userName)
-                    } catch (errMsg) {
-                        _self.showInfo(_self._localeStr.WEB_USBKEYCHECKPASSDETAIL + errMsg.message);
-                        return false
-                    }
-                    if (res != 0) {
-                        _self.showInfo(_self._localeStr.WEB_USBKEYCHECKPASS)
-                    } else {
-                        if (isBatch) {
-                            _private.batchSubmit()
-                        } else {
-                            _private.innerSubmit()
-                        }
-                    }
-                }
-            };
-            var cancel = function () {
-                return
-            };
-            waf.msgBox.showPrompt({
-                title: _self._localeStr.WEB_MESSPROMPT,
-                icon: "prompt",
-                summaryMsg: _self._localeStr.WEB_INPUTUSBKEYPASSWORD,
-                buttonCallBack: [prmt, cancel]
-            });
-            parent.$("#waf-messageBox-prompt-input").prop("type", "password")
-        },
-        batchSubmit: function () {
-            var info = _private.getbatchid();
-            if (info == null) {
-                return
-            }
-            _private._batchsubmit(info)
-        },
-        getbatchid: function () {
-            var info = {};
-            var assignIds = "";
-            var billIds = "";
-            var allbillIds = locationurl.billIds;
-            var allassignmentIds = locationurl.assignmentIds;
-            if (assign.batchApproveUrl) {
-                var frame = document.getElementById("billFrame");
-                billIds = $(frame)[0].contentWindow.waf("#queryGrid").dataGrid("getSelectedRows")
-            } else {
-                billIds = waf("#queryGrid").wafGrid("getSelectedRows")
-            }
-            if (billIds.length == 0) {
-                billIds = allbillIds;
-                assignIds = allassignmentIds
-            } else {
-                for (var i = 0; i < allbillIds.split(";").length; i++) {
-                    var allbillId = allbillIds.split(";")[i];
-                    if (billIds.toString().indexOf(allbillId) > -1) {
-                        if (assignIds != "") {
-                            assignIds += ";"
-                        }
-                        assignIds += allassignmentIds.split(";")[i]
-                    }
-                }
-                billIds = billIds.join(";")
-            }
-            info.billIds = billIds;
-            info.assignIds = assignIds;
-            return info
-        },
-        _batchsubmit: function (info) {
-            var approve = _private.getApprove();
-            if (!approve) {
-                return
-            }
-            var billIds = info.billIds;
-            var assignIds = info.assignIds;
-            approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove;
-            if (caConfig.caConfigInfo.isSignatureApprove === "true" && caConfig.caConfigInfo.caType != "5") {
-                if (!_private.beforeBatchSubmitSigature(billIds)) {
-                    return
-                }
-                approve.plainTextMap = caConfig.plainTextMap;
-                approve.plainSignatureMap = caConfig.plainSignatureMap
-            }
-            var nextPersons = _private.getNextPersons();
-            if (!nextPersons) {
-                return
-            }
-            var ok = function () {
-                var params = {};
-                approve.nextActs = nextPersons;
-                params.approve = JSON.stringify(approve);
-                params.assignIds = assignIds;
-                params.billIds = billIds;
-                waf.doPost({
-                    url: waf.getContextPath() + "/common/tree.do?method=batchSubmits",
-                    data: params,
-                    success: function (data) {
-                        if (data == "OK") {
-                            _self.showSuccess(_self._localeStr.WEB_BATCHAPPROVESUCCESS);
-                            _private.backto()
-                        } else {
-                            _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
-                        }
-                    }
-                })
-            };
-            var cancel = function () {
-                return
-            };
-            if (showerror != "") {
-                waf.msgBox.showConfirm({
-                    title: _self._localeStr.WEB_MESSPROMPT,
-                    summaryMsg: showerror,
-                    buttonType: "ok-cancel",
-                    buttonCallBack: [ok, cancel]
-                })
-            } else {
-                ok()
-            }
-        },
-        getApprove: function () {
-            var opinion = waf("#approveOpinion").val();
-            if (assign.needApproveOpinion && (opinion == null || opinion.trim() == "")) {
-                _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSNOBLANK);
-                return null
-            }
-            if (opinion != null && opinion.length > 1000) {
-                _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSTOOLONG);
-                return null
-            }
-            var ispass = null;
-            var approveResult = waf("#approveResult").wafRadioGroup("getValue");
-            if (approveResult == "false") {
-                ispass = "false";
-                if (assign.mustFillOpinionWhenDisagree == "true") {
-                    if ((opinion == null || opinion.trim() == "") || opinion == _self._localeStr.WEB_DISAGREE) {
-                        _self.showInfo(_self._localeStr.WEB_DISAGREEOPINION);
-                        return null
-                    }
-                }
-            } else {
-                if (approveResult == "true") {
-                    ispass = "true"
-                }
-            }
-            var approve = {};
-            approve.assignId = assign.assignId;
-            approve.id = assign.id;
-            approve.opinion = opinion;
-            var handlerOpinion = waf("#policy").wafSelect("getValue");
-            if (handlerOpinion) {
-                approve.handlerOpinion = handlerOpinion
-            } else {
-                approve.handlerOpinion = "0"
-            }
-            approve.handlerContent = waf("#policy").wafSelect("getSelectedAlias");
-            approve.approveResult = ispass;
-            approve.transitionId = transId;
-            approve.isSendSMS = waf("#sendmsg").wafCheckbox("isChecked") ? "true" : "false";
-            approve.isSendMail = waf("#sendmail").wafCheckbox("isChecked") ? "true" : "false";
-            if (assign.multiapproveinfoId) {
-                approve.id = assign.multiapproveinfoId
-            }
-            var isesignaturecheck = false;
-            if (approvetype == "approve" || approvetype == "batchapprove") {
-                isesignaturecheck = waf("#esignature").wafCheckbox("isChecked")
-            } else {
-                if (approvetype == "manualdecision") {
-                    isesignaturecheck = waf("#esignature1").wafCheckbox("isChecked")
-                }
-            }
-            if (assign.isEsignature && isesignaturecheck) {
-                approve.esignatureid = assign.esignatureId
-            }
-            return approve
-        },
-        beforeBatchSubmitSigature: function (selectBillIds) {
-            var modelIDs = "";
-            var tbillIDs;
-            if (Object.prototype.toString.call(selectBillIds) === "[object Array]") {
-                tbillIDs = selectBillIds
-            } else {
-                tbillIDs = selectBillIds.split(";")
-            }
-            for (var i = 0; i < tbillIDs.length; i++) {
-                if (modelIDs != "") {
-                    modelIDs += ","
-                }
-                modelIDs += tbillIDs[i]
-            }
-            if (modelIDs === undefined || modelIDs == null || modelIDs === "") {
-                waf.msgBox.showError("bill id can't be null");
-                return false
-            }
-            var actionUrl = waf.getContextPath() + "/component/ca.do?method=getPlainTextFromDB&billIDs=" + waf.encodeURIComponent(modelIDs) + "&isFromWF=true";
-            waf.doPost({
-                url: actionUrl,
-                async: false,
-                success: function (data) {
-                    if (data == null || data == "" || data == undefined) {
-                        return false
-                    } else {
-                        caConfig.plainTextMap = data.plainTextMap
-                    }
-                },
-                error: function (data) {
-                    waf.msgBox.showError("getPlainTextFromDB failed");
-                    return false
-                }
-            });
-            var arraySignature = "";
-            var billids = modelIDs.split(",");
-            for (var i = 0; i < billids.length; i++) {
-                var key = billids[i];
-                var signResult = -1;
-                try {
-                    signResult = signMessage(caConfig.plainTextMap[key], caConfig.caConfigInfo.userName)
-                } catch (errMsg) {
-                    _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message);
-                    return false
-                }
-                if (signResult == 1 || signResult == 2 || signResult == 3) {
-                    if (signResult == 1 || signResult == 2) {
-                        _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY)
-                    }
-                    return false
-                }
-                if (arraySignature != "") {
-                    arraySignature += ","
-                }
-                arraySignature += signResult
-            }
-            caConfig.plainSignatureMap = arraySignature;
-            return true
-        },
-        getNextPersons: function (isSave) {
-            var locale = waf.getContext().locale;
-            var symbol = "。";
-            if (locale == "l1") {
-                symbol = "."
-            }
-            showerror = "";
-            var nextPersons = [];
-            var ispass = waf("#approveResult").wafRadioGroup("getValue");
-            if (ispass == "false") {
-                return nextPersons
-            }
-            var isnextact = waf(nextActIndex).wafCheckbox("isChecked");
-            var directActName = "";
-            if (isnextact) {
-                var num = 0;
-                var index = 0;
-                var directCount = 0;
-                var directIsSel = false;
-                for (var i = 0; i != assign.nextActs.length; i++) {
-                    if (_private.isPredict && !assign.nextActs[i].isPredict) {
-                        continue
-                    }
-                    var act = {};
-                    act.actKey = assign.nextActs[i].actKey;
-                    act.persons = {};
-                    var flag = false;
-                    directCount++;
-                    for (var actId in selnextPersons) {
-                        if (actId == assign.nextActs[i].actId) {
-                            var persons = selnextPersons[actId];
-                            for (var id in persons) {
-                                act.persons[id] = "true";
-                                flag = true
-                            }
-                        }
-                    }
-                    if (directCount == 1) {
-                        directIsSel = flag
-                    }
-                    if (!flag) {
-                        if (num < 3) {
-                            if (showerror != "") {
-                                showerror += "、"
-                            }
-                            showerror += assign.nextActs[i].actName
-                        }
-                        num++;
-                        if (num == 1) {
-                            directActName = assign.nextActs[i].actName
-                        }
-                    } else {
-                        nextPersons[index] = act;
-                        index++
-                    }
-                }
-                if (num > 0) {
-                    if (num > 2) {
-                        showerror += _self._localeStr.WEB_ANDSOON + num + _self._localeStr.WEB_NODE
-                    }
-                    if (!isSave && assign.mustSetAllNextPerson) {
-                        _self.showInfo(_self._localeStr.WEB_NEXTACTIVITY + ":" + showerror + symbol);
-                        return null
-                    }
-                    if (!isSave && assign.mustSetAllNextPersonDirectNull && !directIsSel) {
-                        _self.showInfo(_self._localeStr.WEB_NEXTACTIVITY + ":" + directActName + symbol);
-                        return null
-                    }
-                    showerror += _self._localeStr.WEB_NOPARTICIPANTSUBMIT
-                }
-            }
-            return nextPersons
-        },
-        manualdecisionsubmit: function () {
-            var selectValue = waf("#radioDecision").wafRadioGroup("getValue");
-            if (selectValue) {
-                var selItems = $("#radioDecision input[value='" + selectValue + "']").next()[0].innerHTML;
-                var params = {};
-                var nextPersons = _private.getNextPersons();
-                if (!nextPersons) {
-                    return
-                }
-                var ok = function () {
-                    nextPersons = JSON.stringify(nextPersons);
-                    params.nextperson = nextPersons;
-                    params.assignId = assign.assignId;
-                    params.decisionTitle = assign.decisionName;
-                    params.decisionItems = assign.decisionItems;
-                    params.decisionDesc = assign.decisionDesc;
-                    params.decisionOpinions = assign.decisionOpinions;
-                    params.SelectedItems = selItems;
-                    params.SelectedOpinions = selectValue.substr(0, selectValue.indexOf("_"));
-                    waf.doPost({
-                        url: waf.getContextPath() + "/manualdecision/submit.do?method=submit",
-                        data: params,
-                        success: function (data) {
-                            _self.showSuccess(_self._localeStr.WEB_DECISIONSUBMITSUCCESS);
-                            _private.backto()
-                        }
-                    })
-                };
-                var cancel = function () {
-                    return
-                };
-                if (showerror != "") {
-                    waf.msgBox.showConfirm({
-                        title: _self._localeStr.WEB_MESSPROMPT,
-                        summaryMsg: showerror,
-                        buttonType: "ok-cancel",
-                        buttonCallBack: [ok, cancel]
-                    })
-                } else {
-                    ok()
-                }
-            }
-        },
-        beforeInnerSubmit: function () {
-            if (caConfig.caConfigInfo.checkPassword === "true" && caConfig.caConfigInfo.isSignatureApprove === "true" && caConfig.caConfigInfo.caType != "5") {
-                _private.checkCAPassword(false)
-            } else {
-                _private.innerSubmit()
-            }
-        },
-        innerSubmit: function () {
-            if (assign.mustUploadAttachment && waf("#approveResult").wafRadioGroup("getValue") == "true") {
-                var isCurAssignUploadAttach = false;
-                waf.doPost({
-                    url: waf.getContextPath() + "/iwebattachment.do?method=isCurAssignUploadAttach",
-                    data: {
-                        assignId: assign.assignId
-                    },
-                    async: false,
-                    success: function (data) {
-                        if (data == false) {
-                            _self.showWarning(_self._localeStr.WEB_MUSTUPLOAD)
-                        }
-                        isCurAssignUploadAttach = data
-                    }
-                });
-                if (!isCurAssignUploadAttach) {
-                    return
-                }
-            }
-            assign.operation = "approve";
-            var callback = function (isSuccess) {
-                if (isSuccess) {
-                    _private._submit(false)
-                }
-            };
-            var issubmit = _private.checkIsSave(callback, "submit");
-            if (issubmit == null) {
-                _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND);
-                return false
-            }
-            _private._submit(issubmit)
-        },
-        _submit: function (isReadOnly) {
-            var approve = _private.getApprove();
-            if (!approve) {
-                return
-            }
-            var nextPersons = _private.getNextPersons();
-            if (!nextPersons) {
-                return
-            }
-            var ok = function () {
-                approve.operation = assign.operation;
-                var op = approve.operation;
-                if (caConfig.caConfigInfo.isSignatureApprove === "true" && caConfig.caConfigInfo.caType != "5") {
-                    if (!_private.beforeSubmitSigature()) {
-                        return
-                    }
-                    approve.plainText = caConfig.CA_plainText;
-                    approve.signature = caConfig.CA_signature
-                }
-                if (isReadOnly === undefined || isReadOnly === null || isReadOnly === "") {
-                    isReadOnly = true
-                }
-                if (!isReadOnly) {
-                    var frame = document.getElementById("billFrame");
-                    if (frame.contentDocument.getElementById("frame_tab_0") != null && frame.contentDocument.getElementById("frame_tab_0") != undefined) {
-                        frame = frame.contentDocument.getElementById("frame_tab_0")
-                    }
-                    if (frame.contentWindow._self.getCurrentModel) {
-                        var modelInfo = frame.contentWindow._self.getCurrentModel();
-                        var editModel = JSON.stringify(modelInfo);
-                        approve.model = editModel
-                    }
-                    if (approve.model == null) {
-                        if (frame.contentWindow._self.fireEvent) {
-                            var s = frame.contentWindow._self.fireEvent("save");
-                            if (!s) {
-                                return false
-                            }
-                        }
-                    }
-                }
-                approve.isReadOnly = isReadOnly.toString();
-                approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove;
-                approve.nextActs = nextPersons;
-                if ($("#textCC").prop("personIds")) {
-                    approve.ccPersonIds = $("#textCC").prop("personIds")
-                }
-                var params = {};
-                params.approve = JSON.stringify(approve);
-                waf.doPost({
-                    url: waf.getContextPath() + "/common/tree.do?method=submits",
-                    data: params,
-                    success: function (data) {
-                        if (data) {
-                            assign.id = data;
-                            _self.showSuccess(_self._localeStr.WEB_SUBMITSUCCESS);
-                            _private.backto()
-                        } else {
-                            _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
-                        }
-                    }
-                })
-            };
-            var cancel = function () {
-                return
-            };
-            if (showerror != "") {
-                waf.msgBox.showConfirm({
-                    title: _self._localeStr.WEB_MESSPROMPT,
-                    summaryMsg: showerror,
-                    buttonType: "ok-cancel",
-                    buttonCallBack: [ok, cancel]
-                })
-            } else {
-                ok()
-            }
-        },
-        beforeSubmitSigature: function () {
-            var plainText = "";
-            var signatureField = caConfig.caConfigInfo.signatureFields;
-            if (signatureField === null || signatureField === "") {
-                return true
-            }
-            var signatureFields = signatureField.split(";");
-            for (var i = 0; i < signatureFields.length; i++) {
-                var srcValue = "CANOTSIGNATURE";
-                try {
-                    srcValue = eval("document.getElementById('billFrame').contentWindow.document.getElementsByName('" + signatureFields[i] + "')[0].value")
-                } catch (e) {
-                    srcValue = "CANOTSIGNATURE"
-                }
-                if (typeof (srcValue) == "undefined") {
-                    srcValue = "CANOTSIGNATURE"
-                }
-                if (caConfig.caConfigInfo.precisionInfo && caConfig.caConfigInfo.precisionInfo[signatureFields[i]]) {
-                    var pos = parseInt(caConfig.caConfigInfo.precisionInfo[signatureFields[i]]);
-                    if (pos < 0) {
-                        pos = 2
-                    } else {
-                        if (pos > 4) {
-                            pos = 4
-                        }
-                    }
-                    srcValue = _private.toDecimal(srcValue, pos)
-                }
-                plainText = plainText + srcValue
-            }
-            var signResult = -1;
+mod.definePage('workflow/metas/js/approve', function (waf, wfCommonUtil) {
+  var _public = {},
+    _private = {},
+    me = _self
+  var okPolicy = new Array()
+  var noPolicy = new Array()
+  var assign = {}
+  var selnextPersons = {}
+  var transId = null
+  var locationurl = waf.getUrlParams(document.location.href)
+  var approvetype = locationurl.type
+  var passId = locationurl.passid
+  var sourceIDs = locationurl.sourceIDs
+  var msgId = locationurl.msgId
+  var showerror = ''
+  var nextActIndex = '#nextAct'
+  var approveOpinions = {}
+  var isFirst = true
+  var approvePolicy = {}
+  var riskInsight = false
+  var billInsightOption = {}
+  var caConfig = {
+    caConfigInfo: null,
+    rootDiv: null,
+    CA_plainText: null,
+    CA_signature: null,
+    plainTextMap: null,
+    plainSignatureMap: null
+  }
+  waf.extend(_public, {
+    submit: function (event, value) {
+      return _private.submit(event, value)
+    },
+    save: function (event, value) {
+      return _private.save(event, value)
+    },
+    deliver: function (event, value) {
+      return _private.deliver(event, value)
+    },
+    passAssignment: function (event, value) {
+      return _private.passAssignment(event, value)
+    },
+    kickback: function (event, value) {
+      return _private.kickback(event, value)
+    },
+    appendActivity: function (event, value) {
+      return _private.appendActivity(event, value)
+    },
+    dynamicSign: function (event, value) {
+      return _private.dynamicSign(event, value)
+    },
+    jumpto: function (event, value) {
+      return _private.jumpto(event, value)
+    },
+    viewProcessDiagram: function (event, value) {
+      return _private.viewProcessDiagram(event, value)
+    },
+    billImage: function (event, value) {
+      return _private.billImage(event, value)
+    },
+    bill: function (event, value) {
+      return _private.bill(event, value)
+    },
+    showoperate: function (event, value) {
+      return _private.showoperate(event, value)
+    },
+    nextActs: function (event, ui) {
+      return _private.nextActs(event, ui)
+    },
+    modifynextActs: function (event, value) {
+      return _private.modifynextActs(event, value)
+    },
+    changePolicy: function (event, ui) {
+      return _private.changePolicy(event, ui)
+    },
+    changeselPolicy: function (event, ui) {
+      return _private.changeselPolicy(event, ui)
+    },
+    myPhrase: function (event, value) {
+      return _private.myPhrase(event, value)
+    },
+    openPerson: function (event, value) {
+      return _private.openPerson(event, value)
+    },
+    esignatureOnClick: function (event, ui) {
+      return _private.esignatureOnClick(event, ui)
+    },
+    nextAct: function (event, ui) {
+      return _private.nextAct(event, ui)
+    },
+    modifynextAct: function (event, value) {
+      return _private.modifynextAct(event, value)
+    },
+    pageOnload: function (e) {
+      return _private.pageOnload(e)
+    },
+    pageOnRenderBefore: function (e) {
+      return _private.pageOnRenderBefore(e)
+    },
+    phrasedel: function (e) {
+      return _private.phrasedel(e)
+    },
+    phrasesure: function (e) {
+      return _private.phrasesure(e)
+    },
+    addphrase: function (e) {
+      return _private.addphrase(e)
+    },
+    phraseback: function (e) {
+      return _private.phraseback(e)
+    },
+    phraseadd: function (e) {
+      return _private.phraseadd(e)
+    },
+    reloadTranId: function () {
+      return _private.reloadTranId()
+    },
+    getnextacts: function () {
+      return _private.getnextacts()
+    },
+    showtab: function () {
+      return _private.showtab()
+    },
+    setmanualdecision: function () {
+      return _private.setmanualdecision()
+    },
+    setmodifynextAct: function () {
+      return _private.setmodifynextAct()
+    },
+    getbatchlist: function () {
+      return _private.getbatchlist()
+    },
+    displayBillInfo: function (url) {
+      return _private.displayBillInfo(url)
+    },
+    getPolicy: function (approveValueStr) {
+      return _private.getPolicy(approveValueStr)
+    },
+    setPolicy: function (val) {
+      return _private.setPolicy(val)
+    },
+    isNeedDefaultOption: function (vals) {
+      return _private.isNeedDefaultOption(vals)
+    },
+    setsendmailormsg: function (
+      isOpenMessageSendOnUI,
+      notifyNextBySMS,
+      notifyNextByMail
+    ) {
+      return _private.setsendmailormsg(
+        isOpenMessageSendOnUI,
+        notifyNextBySMS,
+        notifyNextByMail
+      )
+    },
+    resizePage: function () {
+      return _private.resizePage()
+    },
+    showapprovehis: function (procInstId) {
+      return _private.showapprovehis(procInstId)
+    },
+    showbtn: function () {
+      return _private.showbtn()
+    },
+    setselnextperson: function (actId, name, id) {
+      return _private.setselnextperson(actId, name, id)
+    },
+    loadNextActs: function () {
+      return _private.loadNextActs()
+    },
+    getOpinion: function (actInstId, assignId, billId) {
+      return _private.getOpinion(actInstId, assignId, billId)
+    },
+    getphrase: function () {
+      return _private.getphrase()
+    },
+    setselnextactperson: function (resultStr) {
+      return _private.setselnextactperson(resultStr)
+    },
+    shownextActs: function (nextactname, ui) {
+      return _private.shownextActs(nextactname, ui)
+    },
+    passComentsubmit: function () {
+      return _private.passComentsubmit()
+    },
+    initCAConfig: function (tCAConfig) {
+      return _private.initCAConfig(tCAConfig)
+    },
+    batchSubmitForCA: function () {
+      return _private.batchSubmitForCA()
+    },
+    checkCAPassword: function (isBatch) {
+      return _private.checkCAPassword(isBatch)
+    },
+    batchSubmit: function () {
+      return _private.batchSubmit()
+    },
+    getbatchid: function () {
+      return _private.getbatchid()
+    },
+    _batchsubmit: function (info) {
+      return _private._batchsubmit(info)
+    },
+    getApprove: function () {
+      return _private.getApprove()
+    },
+    beforeBatchSubmitSigature: function (selectBillIds) {
+      return _private.beforeBatchSubmitSigature(selectBillIds)
+    },
+    getNextPersons: function (isSave) {
+      return _private.getNextPersons(isSave)
+    },
+    manualdecisionsubmit: function () {
+      return _private.manualdecisionsubmit()
+    },
+    beforeInnerSubmit: function () {
+      return _private.beforeInnerSubmit()
+    },
+    innerSubmit: function () {
+      return _private.innerSubmit()
+    },
+    _submit: function (isReadOnly) {
+      return _private._submit(isReadOnly)
+    },
+    beforeSubmitSigature: function () {
+      return _private.beforeSubmitSigature()
+    },
+    toDecimal: function (src, pos) {
+      return _private.toDecimal(src, pos)
+    },
+    checkIsSave: function (callback, type) {
+      return _private.checkIsSave(callback, type)
+    },
+    _save: function (isReadOnly) {
+      return _private._save(isReadOnly)
+    },
+    backto: function () {
+      return _private.backto()
+    },
+    addUploadHtml: function () {
+      return _private.addUploadHtml()
+    },
+    getAttchmentcount: function () {
+      return _private.getAttchmentcount()
+    },
+    selattachment: function (item, attcreater, beizhu) {
+      return _private.selattachment(item, attcreater, beizhu)
+    },
+    attachmentDelete: function (item, id) {
+      return _private.attachmentDelete(item, id)
+    },
+    attachmentView: function (id, type) {
+      return _private.attachmentView(id, type)
+    },
+    isWaf1Bill: function (url) {
+      return _private.isWaf1Bill(url)
+    },
+    messageDigest: function () {
+      return _private.messageDigest()
+    },
+    jMessageAlert: function (message) {
+      return _private.jMessageAlert(message)
+    },
+    onselect: function (event, ui) {
+      return _private.onselect(event, ui)
+    },
+    addphrase: function () {
+      return _private.addphrase()
+    },
+    openAttachmentPage: function (event, value) {
+      return _private.openAttachmentPage(event, value)
+    },
+    getAssignInfo: function () {
+      return _private.getAssignInfo()
+    }
+  })
+  _self.subscribeEvent('pageOnLoadEvent', _public.pageOnload, 'after')
+  _self.subscribeEvent(
+    'pageOnRenderEvent',
+    _public.pageOnRenderBefore,
+    'before'
+  )
+  _self.subscribeEvent('phrasedelActionEvent', _public.phrasedel, 'overwrite')
+  _self.subscribeEvent('phrasesureActionEvent', _public.phrasesure, 'overwrite')
+  _self.subscribeEvent('phrasebackActionEvent', _public.phraseback, 'overwrite')
+  _self.subscribeEvent('phraseaddActionEvent', _public.phraseadd, 'overwrite')
+  waf.extend(_private, {
+    modifyNextAct: '#modifynextAct',
+    charFrameId: 'predictionChartIframe',
+    curTab: '',
+    leftPanelWidth: '',
+    rightPanelWidth: '',
+    isPredict: true,
+    displayBillInfo: function (url) {
+      if (assign.attachmentMode) {
+        if (!url.endsWith('nobill.html')) {
+          url += '&hasAttachment=false'
+        }
+      }
+      waf('#billFrame').wafIframe('option', 'src', url)
+    },
+    getPolicy: function (approveValueStr) {
+      if (approveValueStr == null || approveValueStr == '') {
+        approveValueStr =
+          '0;' +
+          _self._localeStr.WEB_AGREE +
+          ';' +
+          _self._localeStr.WEB_AGREE +
+          ';:1;' +
+          _self._localeStr.WEB_DISAGREE +
+          ';' +
+          _self._localeStr.WEB_DISAGREE +
+          ';'
+      }
+      var strs = approveValueStr.split(':')
+      for (var i = 0; i < strs.length; i++) {
+        var strTemp = strs[i].split(';')
+        var key = strTemp[0]
+        var text = strTemp[1]
+        var type = strTemp.length == 2 ? _self._localeStr.WEB_ALL : strTemp[2]
+        var line = strTemp.length < 4 ? '' : strTemp[3]
+        var o = {}
+        o.alias = text
+        o.value = key
+        if (
+          'agree' == type ||
+          type == _self._localeStr.WEB_AGREE ||
+          '同意' == type
+        ) {
+          okPolicy.push(o)
+        } else {
+          if (
+            'disagree' == type ||
+            type == _self._localeStr.WEB_DISAGREE ||
+            '不同意' == type
+          ) {
+            noPolicy.push(o)
+          } else {
+            if (
+              'all' == type ||
+              type == _self._localeStr.WEB_ALL ||
+              '全部' == type
+            ) {
+              okPolicy.push(o)
+              noPolicy.push(o)
+            }
+          }
+        }
+      }
+    },
+    setPolicy: function (val) {
+      if (val == 'true') {
+        if (isFirst) {
+          isFirst = false
+        } else {
+          approveOpinions.disagree = $('#approveOpinion').val()
+          approvePolicy.disagree = waf('#policy').wafSelect('getValue')
+        }
+        if (approvePolicy.agree) {
+          waf('#policy').wafSelect('setValue', approvePolicy.agree)
+        }
+        $('#approveOpinion').val(approveOpinions.agree)
+        waf('#policy').wafSelect('option', 'enumSource', okPolicy)
+      } else {
+        if (isFirst) {
+          isFirst = false
+        } else {
+          approveOpinions.agree = $('#approveOpinion').val()
+          approvePolicy.agree = waf('#policy').wafSelect('getValue')
+        }
+        if (approvePolicy.disagree) {
+          waf('#policy').wafSelect('setValue', approvePolicy.disagree)
+        }
+        $('#approveOpinion').val(approveOpinions.disagree)
+        waf('#policy').wafSelect('option', 'enumSource', noPolicy)
+      }
+      _private.reloadTranId()
+      if (waf(nextActIndex).wafCheckbox('isChecked')) {
+        _private.loadNextActs()
+      }
+    },
+    isNeedDefaultOption: function (vals) {
+      if (assign.isNeedDefaultOption) {
+        waf('#approveOpinion').val(vals)
+      }
+      if (assign.defaultOpinion != null && assign.defaultOpinion != '') {
+        waf('#approveOpinion').val(assign.defaultOpinion)
+      }
+    },
+    getDefaultOption: function (vals) {
+      if (assign.isNeedDefaultOption) {
+        approveOpinions = {
+          agree: _self._localeStr.WEB_AGREE,
+          disagree: _self._localeStr.WEB_DISAGREE
+        }
+      }
+      if (assign.defaultOpinion != null && assign.defaultOpinion != '') {
+        approveOpinions = {
+          agree: assign.defaultOpinion,
+          disagree: assign.defaultOpinion
+        }
+      }
+    },
+    setsendmailormsg: function (
+      isOpenMessageSendOnUI,
+      notifyNextBySMS,
+      notifyNextByMail
+    ) {
+      waf('#issendmsgormail').wafPanel(
+        'option',
+        'hidden',
+        !isOpenMessageSendOnUI
+      )
+      waf('#sendmsg').wafCheckbox('option', 'hidden', !isOpenMessageSendOnUI)
+      waf('#sendmail').wafCheckbox('option', 'hidden', !isOpenMessageSendOnUI)
+      waf('#sendmsg').wafCheckbox('setChecked', notifyNextBySMS)
+      waf('#sendmail').wafCheckbox('setChecked', notifyNextByMail)
+    },
+    resizePage: function () {
+      var rightwidth = Math.ceil((300 / window.innerWidth) * 100)
+      if (window.screen.width <= 1366) {
+        rightwidth = 21
+      }
+      var leftwidth = 100 - rightwidth
+      waf('#splitPanel').wafSplitPanel('option', {
+        split: false,
+        leftWidth: leftwidth,
+        rightWidth: rightwidth
+      })
+      var billHeightOffset = 220
+      var tabOffset = 100
+      if (assign.newPage && approvetype == 'approve') {
+        billHeightOffset = 160
+        tabOffset = 155
+      }
+      if (approvetype != 'approve') {
+        billHeightOffset -= 120
+      }
+      $('#tabs .ui-waftabs-panel')
+        .eq(0)
+        .height(window.innerHeight - tabOffset)
+      if (approvetype == 'batchapprove') {
+        if (assign.batchApproveUrl) {
+          var times = 0
+          waf('#billFrame').wafIframe(
+            'option',
+            'height',
+            window.innerHeight - 100
+          )
+          var interval = setInterval(function () {
             try {
-                signResult = signMessage(plainText, caConfig.caConfigInfo.userName)
-            } catch (errMsg) {
-                _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message);
-                return false
-            }
-            if (signResult == 1 || signResult == 2 || signResult == 3) {
-                if (signResult == 1 || signResult == 2) {
-                    _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY);
-                    return false
-                }
+              window.frames.billFrame
+                .$('#gview_queryGrid .ui-jqgrid-bdiv')
+                .eq(0)
+                .css('height', window.innerHeight - 220)
+              if (times > 4) {
+                clearInterval(interval)
+              }
+              times++
+            } catch (e) {}
+          }, 500)
+          waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
+        } else {
+          $('#gview_queryGrid .ui-jqgrid-bdiv').height(
+            $('#tabs').height() - 100
+          )
+          $('#gview_queryGrid .ui-jqgrid-bdiv').css('overflow-y', 'auto')
+          $('#panel5 .ui-jqgrid').height($('#tabs').height())
+        }
+      } else {
+        if (assign.messageDigest) {
+          $('#panel5').css({
+            height: window.innerHeight - billHeightOffset,
+            'overflow-y': 'auto',
+            'overflow-x': 'hidden'
+          })
+          $('#bill_content').css({
+            height: window.innerHeight - billHeightOffset,
+            overflow: 'auto'
+          })
+        } else {
+          waf('#billFrame').wafIframe(
+            'option',
+            'height',
+            window.innerHeight - billHeightOffset
+          )
+          waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
+        }
+      }
+      if (assign.absStr || assign.decisionDesc) {
+        _private.changeBillHeight(90, false)
+      }
+      if (approvetype == 'batchapprove' || approvetype == 'approve') {
+        $('#myPhraseList .scrollhid').height($('#approveTask').height() - 100)
+      }
+    },
+    changeBillHeight: function (height, isClose) {
+      var billHeight = 0
+      if (assign.messageDigest) {
+        billHeight = $('#panel5').height()
+      } else {
+        billHeight = waf('#billFrame').wafIframe('option', 'height')
+      }
+      if (isClose) {
+        billHeight += height
+      } else {
+        billHeight -= height
+      }
+      if (assign.messageDigest) {
+        $('#panel5').css({ height: billHeight, 'overflow-y': 'auto' })
+      } else {
+        waf('#billFrame').wafIframe('option', 'height', billHeight)
+        waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
+      }
+    },
+    showapprovehis: function (procInstId) {
+      var params = {}
+      params.embed = 'true'
+      params.proInstId = procInstId
+      waf.doPost({
+        url: waf.getContextPath() + '/flowRelated.do?method=getFlowRealted',
+        data: params,
+        success: function (data) {
+          var _html = ''
+          for (var i = 0; i < data.length; i++) {
+            var action = data[i].action
+            var node = data[i].node
+            if (node == null) {
+              node = ''
+            }
+            var operatorResult = data[i].operatorResult
+            if (operatorResult == '' || operatorResult == null) {
+              operatorResult = action
+            }
+            var op = ''
+            var operatorOpinion = data[i].operatorOpinion
+            if (operatorOpinion == '' || operatorOpinion == null) {
+              operatorOpinion = ''
+            }
+            var classname = 'agree'
+            var type = data[i].type
+            var titlename = ''
+            if (type == 9 || type == 10) {
+              var operatorResults = operatorResult.split(',')
+              if (operatorResults.length == 2) {
+                op +=
+                  '<span title=' +
+                  _self._localeStr.WEB_APPROVALRESULTS +
+                  '>' +
+                  _self._localeStr.WEB_APPROVALRESULTS +
+                  ":</span><span title='" +
+                  operatorResults[0] +
+                  "'>" +
+                  operatorResults[0] +
+                  '</span><br/>'
+                op +=
+                  '<span title=' +
+                  _self._localeStr.WEB_HANDLEROPINIONS +
+                  '>' +
+                  _self._localeStr.WEB_HANDLEROPINIONS +
+                  ":</span><span title='" +
+                  operatorResults[1] +
+                  "'>" +
+                  operatorResults[1] +
+                  '</span><br/>'
+                if (
+                  operatorResults[0] == _self._localeStr.WEB_DISAGREE ||
+                  operatorResults[0] == 'Disagree'
+                ) {
+                  classname = 'disagree'
+                }
+              } else {
+                op +=
+                  "<span title='" +
+                  operatorResult +
+                  "'>" +
+                  operatorResult +
+                  '</span><br/>'
+              }
+              titlename = _self._localeStr.WEB_APPROVALCOMMENTS
             } else {
-                caConfig.CA_plainText = plainText;
-                caConfig.CA_signature = signResult
-            }
-            return true
-        },
-        toDecimal: function (src, pos) {
-            var f = parseFloat(src);
-            if (isNaN(f)) {
-                return false
-            }
-            var src_rs = src.indexOf(".");
-            if (src_rs > 0) {
-                var src_zero = src.lastIndexOf("0");
-                while (src.length == src_zero + 1) {
-                    src = src.substring(0, src_zero);
-                    src_zero = src.lastIndexOf("0")
-                }
-                if (src.length == src_rs + 1) {
-                    var src_int = src.substring(0, src_rs);
-                    src = src_int
-                }
-                if (pos == 0) {
-                    return src
-                }
-            }
-            var f = Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
-            var s = f.toString();
-            var rs = s.indexOf(".");
-            if (rs < 0 && pos > 0) {
-                rs = s.length;
-                s += "."
-            }
-            while (s.length <= rs + pos) {
-                s += "0"
-            }
-            return s
-        },
-        save: function (event, value) {
-            var callback = function (isSuccess) {
-                if (isSuccess) {
-                    _private._save()
-                }
-            };
-            var issubmit = _private.checkIsSave(callback, "save");
-            if (issubmit == "callBack") {
-                return
-            }
-            if (issubmit == null) {
-                _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND);
-                return false
-            }
-            _private._save(issubmit);
-            if (!issubmit && riskInsight) {
-                billInsightOption = _private.getWeakRisk();
-                _private.updateBillInsightNum(billInsightOption)
-            }
-        },
-        checkIsSave: function (callback, type) {
-            var issubmit = null;
-            if (!assign.billIsReadOnly) {
-                if (type == "submit" && assign.disagreenotsave && waf("#approveResult").wafRadioGroup("getValue") == "false") {
-                    return true
-                }
-                var frame = document.getElementById("billFrame");
-                if (frame) {
-                    if (frame.contentWindow._self && frame.contentWindow._self.saveAndCallBack) {
-                        frame.contentWindow._self.saveAndCallBack(callback);
-                        return "callBack"
+              op +=
+                "<span title='" +
+                operatorResult +
+                "'>" +
+                operatorResult +
+                '</span><br/>'
+              if (type == 1) {
+                classname = 'jump'
+                titlename = _self._localeStr.WEB_JUMPCOMMENTS
+              } else {
+                if (type == 2) {
+                  classname = 'append'
+                  titlename = _self._localeStr.WEB_COUNTERSIGNCOMMENTS
+                } else {
+                  if (type == 4) {
+                    classname = 'stop'
+                    titlename = _self._localeStr.WEB_ENDCOMMENTS
+                  } else {
+                    if (type == 3) {
+                      classname = 'deliver'
+                      titlename = _self._localeStr.WEB_TRANSFERRCOMMENTS
                     } else {
-                        var canSaveBill = false;
-                        var haveChangeBill = null;
-                        var contentWindowSelf = null;
-                        if (frame.contentWindow._self) {
-                            contentWindowSelf = frame.contentWindow._self
-                        } else {
-                            if (frame.contentDocument.getElementById("frame_tab_0") && frame.contentDocument.getElementById("frame_tab_0").contentWindow._self) {
-                                contentWindowSelf = frame.contentDocument.getElementById("frame_tab_0").contentWindow._self
-                            }
-                        }
-                        if (contentWindowSelf) {
-                            var WFBizSubmitCheckPriority = false;
-                            if (contentWindowSelf.isWFBizSubmitCheckPriority) {
-                                WFBizSubmitCheckPriority = contentWindowSelf.isWFBizSubmitCheckPriority()
-                            }
-                            if (WFBizSubmitCheckPriority) {
-                                if (contentWindowSelf.fireEvent) {
-                                    haveChangeBill = contentWindowSelf.fireEvent("judgeDataModifyActionEvent", ["workflow"])
-                                }
-                                if (contentWindowSelf.beforeSubmit) {
-                                    canSaveBill = contentWindowSelf.beforeSubmit()
-                                } else {
-                                    if (contentWindowSelf.fireEvent) {
-                                        canSaveBill = contentWindowSelf.fireEvent("fieldOnStoreEvent") && contentWindowSelf.fireEvent("submitBeforeActionEvent")
-                                    }
-                                }
-                            } else {
-                                if (contentWindowSelf.beforeSubmit) {
-                                    canSaveBill = contentWindowSelf.beforeSubmit()
-                                } else {
-                                    if (contentWindowSelf.fireEvent) {
-                                        canSaveBill = contentWindowSelf.fireEvent("fieldOnStoreEvent") && contentWindowSelf.fireEvent("submitBeforeActionEvent")
-                                    }
-                                }
-                                if (contentWindowSelf.fireEvent) {
-                                    haveChangeBill = contentWindowSelf.fireEvent("judgeDataModifyActionEvent", ["workflow"])
-                                }
-                            }
-                            if (canSaveBill) {
-                                if (typeof haveChangeBill == "boolean") {
-                                    issubmit = !haveChangeBill
-                                } else {
-                                    issubmit = false
-                                }
-                            }
-                        } else {
-                            issubmit = true
-                        }
+                      if (type == 0) {
+                        classname = 'jump'
+                        titlename = _self._localeStr.WEB_REJECTCOMMENTS
+                      }
                     }
-                } else {
-                    issubmit = true
-                }
+                  }
+                }
+              }
+            }
+            if (titlename != '') {
+              op +=
+                "<span title='" +
+                titlename +
+                "'>" +
+                titlename +
+                ":</span><span title='" +
+                operatorOpinion +
+                "'>" +
+                operatorOpinion +
+                '</span><br/>'
+            }
+            if (i > 0) {
+              if (data[i].node == data[i - 1].node) {
+                _html +=
+                  '<div class="infos">	<div class="content">		<div class="title">			<i></i>			<span style="float:left;">' +
+                  data[i].operatorTime +
+                  '</span>			<span style="float:right;">' +
+                  data[i].operator +
+                  '</span>		</div>		<div class="op">' +
+                  op +
+                  '</div>	</div></div>'
+                if (i != data.length - 1) {
+                  if (data[i].node != data[i + 1].node) {
+                    _html += '</div></li>'
+                  }
+                }
+                continue
+              }
+            }
+            _html +=
+              '<li><div class="node">	<i class="' +
+              classname +
+              '"></i>	<span>' +
+              node +
+              '</span></div>'
+            if (i != data.length - 1) {
+              if (data[i].node == data[i + 1].node) {
+                _html += '<div class="info"><div class="infos">'
+              } else {
+                _html += '<div class="info">'
+              }
             } else {
-                issubmit = true
-            }
-            return issubmit
-        },
-        _save: function (isReadOnly) {
-            assign.operation = "approve";
-            var approve = _private.getApprove();
-            if (!approve) {
-                return
-            }
-            if (isReadOnly === undefined || isReadOnly === null || isReadOnly === "") {
-                isReadOnly = true
-            }
-            if (!isReadOnly) {
-                var frame = document.getElementById("billFrame");
-                if (frame.contentDocument.getElementById("frame_tab_0") != null && frame.contentDocument.getElementById("frame_tab_0") != undefined) {
-                    frame = frame.contentDocument.getElementById("frame_tab_0")
-                }
-                if (frame.contentWindow._self.getCurrentModel) {
-                    var modelInfo = frame.contentWindow._self.getCurrentModel();
-                    var editModel = JSON.stringify(modelInfo);
-                    approve.model = editModel
-                }
-                if (approve.model == null) {
-                    if (frame.contentWindow._self.fireEvent) {
-                        var s = frame.contentWindow._self.fireEvent("save");
-                        if (!s) {
-                            return false
-                        }
-                    }
-                }
-            }
-            approve.isReadOnly = isReadOnly.toString();
-            if ($("#textCC").prop("personIds")) {
-                approve.ccPersonIds = $("#textCC").prop("personIds");
-                approve.personName = $("#textCC").prop("value")
-            }
-            var params = {};
-            params.approve = JSON.stringify(approve);
-            waf.doPost({
-                url: waf.getContextPath() + "/common/tree.do?method=saves",
-                data: params,
-                success: function (data) {
-                    if (data) {
-                        assign.id = data;
-                        _self.showSuccess(_self._localeStr.WEB_SAVESUCCESS)
-                    }
-                }
-            })
-        },
-        backto: function () {
-            try {
-                if ($("#billFrame").length > 0 && $("#billFrame")[0].contentWindow._self.fireEvent) {
-                    $("#billFrame")[0].contentWindow._self.fireEvent("destroyEvent")
-                }
-            } catch (e) {
-                console.log("流程中心手动释放单据锁失败")
-            }
-            if (waf.isInFramePage()) {
-                waf.closeCurPageTab()
+              _html += '<div class="info">'
+            }
+            _html += '	<div class="content">		<div class="title">'
+            if (i != data.length - 1) {
+              if (data[i].node == data[i + 1].node) {
+                _html += '<i></i>'
+              }
+            }
+            _html +=
+              '			<span style="float:left;">' +
+              data[i].operatorTime +
+              '</span>			<span style="float:right;">' +
+              data[i].operator +
+              '</span>		</div>		<div class="op">' +
+              op +
+              '</div>	</div></div>'
+            if (i != data.length - 1) {
+              if (data[i].node != data[i + 1].node) {
+                _html += '</li>'
+              }
+            }
+          }
+          if (!_html) {
+            _html = _self._localeStr.WEB_NOAPPROVALRECORDS
+          }
+          $('#approveHisInfo ul')[0].innerHTML = _html
+        }
+      })
+    },
+    showbtn: function () {
+      waf('#dynamicSign').wafLinkButton('option', 'hidden', !assign.dynamicSign)
+      waf('#appendActivity').wafLinkButton(
+        'option',
+        'hidden',
+        !assign.allowAppendActivity || approvetype == 'manualdecision'
+      )
+      waf('#jumpto').wafLinkButton('option', 'hidden', !assign.allowJumpTo)
+      waf('#kickback').wafLinkButton('option', 'hidden', !assign.allowKickBack)
+      waf('#deliver').wafLinkButton('option', 'hidden', !assign.allowDeliver)
+      waf('#YZJShare').wafLinkButton('option', 'hidden', true)
+      if (assign.allowJumpTo || assign.allowKickBack) {
+        var assignId = assign.assignId
+        waf.doPost({
+          url:
+            waf.getContextPath() +
+            '/common/tree.do?method=getJumpAndKickBackModel',
+          async: false,
+          data: { assignId: assignId },
+          success: function (data) {
+            if (assign.allowJumpTo) {
+              waf('#jumpto').wafLinkButton('option', 'hidden', !data.jumpTo)
+            }
+            if (assign.allowKickBack) {
+              waf('#kickback').wafLinkButton('option', 'hidden', !data.kickBack)
+            }
+          }
+        })
+      }
+      if (
+        assign.canSpecifyNextPerformer ||
+        assign.mustShowPostActivities ||
+        assign.showNextP
+      ) {
+        if (assign.mustShowPostActivities || assign.showNextP) {
+          waf(nextActIndex).wafCheckbox('option', 'checked', true)
+        }
+      } else {
+        waf(nextActIndex).wafCheckbox('option', 'hidden', true)
+      }
+      if (approvetype == 'batchapprove') {
+        waf('#btnImage').wafLinkButton('option', 'hidden', false)
+        waf('#btnBill').wafLinkButton('option', 'hidden', false)
+      }
+      if (approvetype == 'approve') {
+        waf('#save').wafLinkButton('option', 'hidden', false)
+      }
+    },
+    setselnextperson: function (actId, name, id) {
+      var ps = {}
+      if (selnextPersons[actId]) {
+        ps = selnextPersons[actId]
+        if (ps[id]) {
+          return
+        }
+      }
+      ps[id] = { number: '', name: name, id: id }
+      selnextPersons[actId] = ps
+    },
+    loadNextActs: function () {
+      _private.getnextacts()
+      var nextActs = assign.nextActs
+      _private.innerloadNextActs(nextActs)
+    },
+    innerloadNextActs: function (nextActs, selectAct) {
+      var table = $('#nextActList')
+      var _innerhtml = ''
+      if (nextActs) {
+        var actTitles = {}
+        if (nextActs.length == 0) {
+          _innerhtml +=
+            '<div>' + _self._localeStr.WEB_NOSETACTIVITYPERSON + '</div>'
+          $(_private.modifyNextAct).wafLinkButton('option', 'hidden', true)
+        } else {
+          var hasAct = false
+          var selectActobj = {}
+          if (selectAct) {
+            for (var actid in selectAct) {
+              selectActobj[actid] = actid
+            }
+          }
+          for (var i = 0; i != nextActs.length; i++) {
+            var act = nextActs[i]
+            var num = 0
+            var actId = act.actId
+            var candidateselected = act.candidateselected
+            if (!selectActobj[actId]) {
+              for (var id in candidateselected) {
+                _private.setselnextperson(actId, candidateselected[id], id)
+                num++
+              }
+            }
+            if (_private.isPredict && !act.isPredict) {
+              continue
+            }
+            hasAct = true
+            var actKey = act.actKey
+            var actName = act.actName
+            var isAllPersonAsPerformer = act.isAllPersonAsPerformer
+            var persons = act.persons
+            var count = act.count
+            var issel = false
+            var title = ''
+            if (num > 0) {
+              issel = true
+            }
+            _innerhtml +=
+              "<div class='actInfo' actId='" +
+              actId +
+              "' actKey='" +
+              actKey +
+              "' title='" +
+              actName +
+              "'>" +
+              actName +
+              "</div><div class='actInfoperson' id='" +
+              actId +
+              "'>"
+            if (issel) {
+              _innerhtml += _self._localeStr.WEB_SELECTED
+              var j = 0
+              for (var id in candidateselected) {
+                if (j > 0) {
+                  title += '、'
+                }
+                title += candidateselected[id]
+                if (j > 2) {
+                  j++
+                  continue
+                }
+                if (j > 0) {
+                  _innerhtml += '、'
+                }
+                _innerhtml +=
+                  "<span class='persons' personid='" +
+                  id +
+                  "'>" +
+                  candidateselected[id] +
+                  '</span>'
+                j++
+              }
+              actTitles[actId] = title
+              if (j > 2) {
+                _innerhtml +=
+                  _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
+              }
             } else {
-                if (top && top.jMessager && top.jMsgcenter && top.jMsgcenter.tab_post_add) {
-                    setTimeout(function () {
-                        top.jMessager.sendMsg(top.jMsgcenter.tab_close)
-                    }, 800)
-                } else {
-                    setTimeout(function () {
-                        try {
-                            if (window.opener) {
-                                if (window.opener.refreshCurrentPage) {
-                                    window.opener.refreshCurrentPage()
-                                }
-                                if (opener.waf && opener.waf("#queryGrid")[0] != undefined) {
-                                    opener.waf("#queryGrid").wafGrid("reloadGrid")
-                                }
-                            }
-                        } catch (e) { }
-                        try {
-                            // 尝试关闭窗口
-                            window.close();
-                            // 检查窗口是否仍然存在,如果存在则表示没有权限
-                            if (!window.closed) {
-                                console.log("没有权限关闭窗口。");
-                                location.href = "/shr/dynamic.do?uipk=shr.workflow.view&inFrame=true&target=allMessageConfig";
-                            }
-                        } catch (error) {
-                            console.log("关闭窗口失败:", error.message);
-                            _self.showSuccess(_self._localeStr.WEB_TASKHASDONE)
-                        }
-                    }, 500)
-                }
-            }
-        },
-        addUploadHtml: function () {
-            var attachmentUploadUrl = waf.getContextPath() + "/iwebattachment.do?method=upload&bosID=" + encodeURIComponent(assign.billId) + "&beizhu=" + assign.assignId;
-            var options = {
-                autoUpload: true,
-                url: attachmentUploadUrl,
-                multiSelect: true,
-                onComplete: function (e, data) {
-                    _private.getAttchmentcount()
-                },
-                onAdd: function (e, data) { },
-                onFail: function (e, data) {
-                    if (data.result.length > 0) {
-                        if (data.result[0].error) {
-                            _self.showInfo(data.result[0].error)
-                        }
-                    }
-                }
-            };
-            $("#upload").wafFileUploadUI(options);
-            _private.getAttchmentcount()
-        },
-        getAttchmentcount: function () {
-            var params = {};
-            params.assignId = assign.assignId;
-            params.billId = assign.billId;
-            var pageType = _self.getUrlParam("type");
-            if (pageType != null && "passComent" === pageType) {
-                params.isPassAround = true
-            }
-            waf.doPost({
-                url: waf.getContextPath() + "/iwebattachment.do?method=getDataList",
-                data: params,
-                success: function (data) {
-                    if (data.disabled) {
-                        $("#attchment,.attchmentnuminfo,#upload").remove();
-                        return
-                    }
-                    if (!data.canAdd) {
-                        $("#upload").remove()
-                    }
-                    var len = data.list.length;
-                    $("#attchmentnum").html(len);
-                    if (len > 0) {
-                        waf("#attchment").wafSection("open")
-                    } else {
-                        waf("#attchment").wafSection("close")
-                    }
-                    var _html = "";
-                    for (var i = 0; i < len; i++) {
-                        var row = data.list[i];
-                        var simpleName = row.simpleName;
-                        var classname = "file";
-                        var picFormat = ["jpg", "gif", "jpeg", "png", "bmp"];
-                        if (picFormat.indexOf(simpleName) > -1) {
-                            classname = "pic"
-                        }
-                        _html += '<li><div><i class="' + classname + '"></i><span class="name" title="' + row.name + "." + simpleName + '">' + row.name + "." + simpleName + '</span><span class="size">(' + row.size + ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' + row.id + '" download="' + row.name + "." + simpleName + '" target="_blank"></a>';
-                        if (classname == "pic") {
-                            _html += '<i class="preview" onclick="javascript:_self.attachmentView(\'' + row.id + "','pic')\"></i>"
-                        } else {
-                            if (simpleName == "pdf") {
-                                _html += '<i class="preview" onclick="javascript:_self.attachmentView(\'' + row.id + "','pdf')\"></i>"
-                            }
-                        }
-                        if (row.canDelete) {
-                            _html += '<i class="delete" onclick="javascript:_self.attachmentDelete(\'' + row["boAttchAsso.id"] + "','" + row.id + "')\"></i>"
-                        }
-                        _html += "</div></li>"
-                    }
-                    $("#attachmentContent ul")[0].innerHTML = _html
-                }
-            })
-        },
-        attachmentDelete: function (bosId, attachId) {
-            var ok = function () {
-                waf.doPost({
-                    url: waf.getContextPath() + "/iwebattachment.do?method=delete",
-                    data: {
-                        bosId: bosId,
-                        attachId: attachId
-                    },
-                    success: function (data) {
-                        _self.showSuccess(_self._localeStr.WEB_ATTACHMENTDELETESUCESS);
-                        _self.getAttchmentcount()
-                    }
-                })
-            };
-            var cancel = function () {
-                return
-            };
-            waf.msgBox.showConfirm({
-                title: _self._localeStr.WEB_MESSPROMPT,
-                summaryMsg: _self._localeStr.WEB_DeleteFile,
-                buttonType: "ok-cancel",
-                buttonCallBack: [ok, cancel]
-            })
-        },
-        attachmentView: function (id, type) {
-            var url = "";
-            if (type == "pic") {
-                url = "/easweb/webviews/workflow/viewpic.jsp?bosID=" + id
+              if (count > 0) {
+                _innerhtml += ''
+                var j = 0
+                for (var id in persons) {
+                  if (j > 0) {
+                    title += '、'
+                  }
+                  title += persons[id]
+                  if (j > 2) {
+                    _innerhtml +=
+                      _self._localeStr.WEB_ANDSOON +
+                      count +
+                      _self._localeStr.WEB_PEOPLE
+                    break
+                  }
+                  if (j > 0) {
+                    _innerhtml += '、'
+                  }
+                  _innerhtml +=
+                    "<span class='persons' personid='" +
+                    id +
+                    "'>" +
+                    persons[id] +
+                    '</span>'
+                  j++
+                }
+                actTitles[actId] = title
+              } else {
+                _innerhtml += _self._localeStr.WEB_UNSELECTEDPERSON
+              }
+            }
+            _innerhtml += '</div>'
+          }
+          if (!hasAct) {
+            _innerhtml += '<div>' + _self._localeStr.WEB_POINTNEXTTIP + '</div>'
+          }
+          $(_private.modifyNextAct).wafLinkButton('option', 'hidden', false)
+        }
+        table.html(_innerhtml)
+        for (var actTitle in actTitles) {
+          $('#' + actTitle).attr('title', actTitles[actTitle])
+        }
+      }
+    },
+    getOpinion: function (actInstId, assignId, billId) {
+      var params = {}
+      params.actInstId = actInstId
+      params.assignId = assignId
+      params.billId = billId
+      params.type = approvetype
+      waf.doPost({
+        url: waf.getContextPath() + '/workflow/approve.do?method=getOpinion',
+        data: params,
+        success: function (data) {
+          if (
+            data != null &&
+            data != '' &&
+            data.option != null &&
+            data.option != ''
+          ) {
+            $('#approveOpinionInfo span').text(data.option)
+          } else {
+            $('#approveOpinionInfo').hide()
+          }
+        }
+      })
+    },
+    supportMulti: function () {
+      $('#approveDeliverBtn span').text(_self._localeStr.WEB_DELIVER)
+      $('#approvePassBtn span').text(_self._localeStr.WEB_CIRCULATEBTN)
+      $('#approveAppendBtn span').text(_self._localeStr.WEB_ADDSIGN)
+      $('#approveDynamicSignBtn span').text(_self._localeStr.WEB_CONTERSIGNED)
+      $('#approveSaveBtn span').text(_self._localeStr.WEB_SAVE)
+      $('#approveSubmitBtn span').text(_self._localeStr.WEB_SUBMIT)
+      $('#btnUpload').prepend(_self._localeStr.WEB_UPLOADATTACH)
+      $('#attachmul1').prepend(_self._localeStr.WEB_ATTCHNUM)
+      $('#attchmul2').prepend(_self._localeStr.WEB_VIEWDETAIL)
+      $('#attachmul3').prepend(_self._localeStr.WEB_ATTCHGE)
+      $('#attchment').append($('.attchmentnuminfo'))
+      $('#attchment').append($('#upload'))
+      $('#myPhraseInfo .edit').text(_self._localeStr.WEB_SAVE)
+      $('#myPhraseInfo .backprevious').text(_self._localeStr.WEB_BACK)
+      $('#myPhraseInfo .commit').text(_self._localeStr.WEB_DETERMINE)
+      $('#myPhrasetext').prop(
+        'placeholder',
+        _self._localeStr.WEB_ENTER_COMMENTS
+      )
+    },
+    initApprove: function () {
+      if (assign.riskInsight) {
+        _private.initRiskInsight()
+      } else {
+        waf('#riskInsight').wafTab('remove')
+      }
+      _private.initEsignature()
+      _private.initCCPerson()
+      _private.showbtn()
+      _private.initBillPage()
+      _private.initAttachment()
+      _private.initOperateIframe()
+      _private.initAbstractAndPhrase()
+      _private.initApprovePolicy()
+    },
+    initBatchapprove: function () {
+      _private.initEsignature()
+      _private.showbtn()
+      locationurl.billIds = decodeURIComponent(parent.window.billIDs)
+      locationurl.assignmentIds = parent.window.assignmentIDs
+      _private.getbatchlist()
+      _private.initAbstractAndPhrase()
+      _private.initApprovePolicy()
+      waf('#attchment').wafSection('option', 'hidden', true)
+      $('#upload').remove()
+      $('#operateInfo').remove()
+      $('.attchmentnuminfo').remove()
+    },
+    initManualdecision: function () {
+      _private.initManualdecisionNextAct()
+      _private.showbtn()
+      _private.initBillPage()
+      _private.initAttachment()
+      _private.initOperateIframe()
+      _private.initDecisionDescAndVal()
+    },
+    initPassComent: function () {
+      if (assign.passcoment != null) {
+        waf('#passComentOpinion').val(assign.passcoment)
+      }
+      if (assign.isFeedBack) {
+        waf('#sendmsgs').wafCheckbox('disable')
+        waf('#sendmails').wafCheckbox('disable')
+      }
+      waf('#submit').wafLinkButton('option', 'hidden', assign.isFeedBack)
+      waf('#passAssignment').wafLinkButton(
+        'option',
+        'hidden',
+        assign.againPass === 'false'
+      )
+      _private.initBillPage()
+      _private.initAttachment()
+      _private.initOperateIframe()
+    },
+    initManualdecisionNextAct: function () {
+      nextActIndex = '#nextAct1'
+      _private.modifyNextAct = '#modifynextAct1'
+      if (waf(nextActIndex).wafCheckbox('isChecked')) {
+        _private.loadNextActs()
+      }
+    },
+    initRiskInsight: function () {
+      try {
+        mod.use('billInsight', function () {
+          riskInsight = true
+          $('#form').append(
+            '<div id="billInsight" class="" ctrlrole="waf.billInsight" data-domcreated="true"></div>'
+          )
+          $('#li_approveTask').css('width', '50%')
+          $('#li_riskInsight').show()
+          billInsightOption = _private.getWeakRisk()
+          _private.updateBillInsightNum(billInsightOption)
+          $(window).resize(function () {
+            _private.resizeBillInsight(true)
+          })
+        })
+      } catch (e) {
+        console.log(_self._localeStr.WEB_CONSOLETEXT)
+      }
+    },
+    initCCPerson: function () {
+      if (assign.allowCC) {
+        $('#panelCC').show()
+      }
+      if (assign.ccPersonIds != null && assign.ccPersonName != null) {
+        waf('#textCC').prop('personIds', assign.ccPersonIds)
+        waf('#textCC').val(assign.ccPersonName)
+      }
+    },
+    initEsignature: function () {
+      if (
+        !assign.isEsignature ||
+        assign.esignatureAttachId == undefined ||
+        assign.esignatureAttachId == ''
+      ) {
+        $('#panel6').remove()
+      } else {
+        var _html =
+          "<img src='/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=" +
+          assign.esignatureAttachId +
+          "'/>"
+        $('#esigndiv')[0].innerHTML = _html
+      }
+    },
+    initBillPage: function () {
+      if (assign.messageDigest) {
+        try {
+          _private.messageDigest()
+        } catch (e) {
+          console.log(_self._localeStr.WEB_BILLINITFAILED)
+        }
+      } else {
+        if (!assign.billEditUrl || assign.billEditUrl == 'nobill.html') {
+          assign.billEditUrl = '/easweb/webviews/workflow/nobill.html?'
+        }
+        if (approvetype == 'passComent' && msgId) {
+          assign.billEditUrl =
+            assign.billEditUrl + '&msgId=' + encodeURIComponent(msgId)
+        }
+        _private.displayBillInfo(assign.billEditUrl)
+      }
+    },
+    initAttachment: function () {
+      waf('#attachmentBtn').wafLinkButton(
+        'option',
+        'hidden',
+        assign.attachDisabled
+      )
+      _private.refreshAttachCountInner(assign.attachmentCount)
+    },
+    initOperateIframe: function () {
+      var url =
+        '/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.approveRelatedInfo&isshowapprove=true&assignmentId=' +
+        assign.assignId
+      waf('#operateiframe').wafIframe('option', 'src', url)
+    },
+    initApprovePolicy: function () {
+      _private.getPolicy(assign.approveValue)
+      _private.getDefaultOption()
+      if (assign.id) {
+        waf('#approveResult').wafRadioGroup('setValue', assign.approveResult)
+        waf('#policy').wafSelect('setValue', assign.handlerOpinion)
+      } else {
+        waf('#approveResult').wafRadioGroup('setValue', 'true')
+      }
+    },
+    initAbstractAndPhrase: function () {
+      if (assign.absStr) {
+        waf('#optionalSection').wafSection(
+          'option',
+          'title',
+          _self._localeStr.WEB_PROCESSSUMMARY
+        )
+        waf('#optionalSection').wafSection('option', 'hidden', false)
+        $('#description').text(assign.absStr)
+      }
+      _private.getphrase()
+      $('#myPhraseList').on('click', 'li', function (e) {
+        _private.clickPhrase(e)
+      })
+      $('#myPhraseList').on('dblclick', 'li', function (e) {
+        _private.dblclickPhrase(e)
+      })
+      $('#myPhraseList').on('click', 'li i', function (e) {
+        _private.phrasedel(e)
+      })
+    },
+    initDecisionDescAndVal: function () {
+      if (assign.decisionDesc) {
+        waf('#optionalSection').wafSection(
+          'option',
+          'title',
+          _self._localeStr.WEB_DECISONDESC
+        )
+        waf('#optionalSection').wafSection('option', 'hidden', false)
+        $('#description').text(assign.decisionDesc)
+        _private.changeBillHeight(85, false)
+      }
+      _private.setmanualdecision()
+    },
+    initCalProcDiagram: function () {
+      var url =
+        '/easweb/webviews/workflow/calProcDiagramNew.jsp?procInstId=' +
+        assign.procInstId +
+        '&actinstId=' +
+        assign.actInstId +
+        '&newPage=' +
+        assign.newPage
+      waf('#' + _private.charFrameId).wafIframe('option', 'src', url)
+      var urlWin =
+        '/easweb/webviews/workflow/calProcDiagram.jsp?procInstId=' +
+        assign.procInstId +
+        '&actinstId=' +
+        assign.actInstId
+      waf('#chartIframe').wafIframe('option', 'src', urlWin)
+      $('#chart').click(function () {
+        $('#chart').hide()
+      })
+      $('#chartClose').click(function () {
+        $('#chart').hide()
+      })
+      $('#openChartIframe').click(function () {
+        $('#chart').show()
+      })
+      var times = 0
+      var interval = setInterval(function () {
+        if (window.frames[_private.charFrameId]) {
+          var num = window.frames[_private.charFrameId].num
+          if (num > 0) {
+            var iWidth = window.innerWidth * (4 / 5)
+            var rowNum = parseInt(iWidth / 176)
+            var calcHeight = Math.ceil(num / rowNum) * 140
+            var winHeight = ''
+            if (top == parent.parent) {
+              winHeight = window.innerHeight
             } else {
-                if (type == "pdf") {
-                    url = "/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=" + id
-                }
-            }
-            window.open(url, "_blank")
-        },
-        billImage: function (event, value) {
-            var params = {};
-            params.billID = assign.billId;
-            params.method = "getimageurl";
-            waf.doPost({
-                url: waf.getContextPath() + "/workflow/approve.do",
-                data: params,
-                success: function (data) {
-                    var url = data.imgurl;
-                    if (url == "") {
-                        _self.showWarning(_self._localeStr.WEB_IMAGESTATE + data.state + _self._localeStr.WEB_SUPPORTSTATE)
-                    } else {
-                        if (url == "noImg") {
-                            _self.showWarning(_self._localeStr.WEB_HASNOIMAGE)
-                        } else {
-                            wfCommonUtil.windowopen(url, _self._localeStr.WEB_IMAGE, "", "")
-                        }
-                    }
-                }
+              winHeight = window.screen.availHeight - 120
+            }
+            var iHeight = winHeight * (4 / 5)
+            if (calcHeight < iHeight) {
+              iHeight = calcHeight
+            }
+            var iTop = (winHeight - 70 - iHeight) / 2
+            var iLeft = (window.innerWidth - 10 - iWidth) / 2
+            $('#chartIframe').css({
+              'margin-left': iLeft,
+              'margin-top': iTop,
+              width: iWidth,
+              height: iHeight
             })
-        },
-        bill: function (event, value) {
-            var para = {};
-            if (approvetype == "batchapprove") {
-                var assignIds = _private.getbatchid().assignIds;
-                if (assignIds.split(";").length != 1) {
-                    _self.showInfo(_self._localeStr.WEB_SELECTARECORD);
-                    return false
-                }
-                para.sourceID = assignIds
-            } else {
-                para.sourceID = assign.assignId
+          }
+        }
+        times++
+        if (times > 100) {
+          clearInterval(interval)
+        }
+      }, 100)
+    },
+    initPageLayout: function () {
+      if (assign.newPage) {
+        $('#predictionChart').remove()
+        _private.charFrameId = 'predictionChartIframeNew'
+        _private.initBtnNew()
+      } else {
+        $('#predictionChartNew').remove()
+      }
+      if (
+        locationurl.isOpenNewTab != undefined &&
+        locationurl.isOpenNewTab == 'true'
+      ) {
+        $('#nextActList').css('height', '20vh')
+      }
+    },
+    initCalProcDiagramPanel: function () {
+      if (approvetype == 'approve') {
+        _private.initCalProcDiagram()
+      } else {
+        $('#chart').remove()
+        $('#predictionChart').remove()
+        $('#predictionChartNew').remove()
+      }
+    },
+    initSection: function () {
+      if (approvetype != 'batchapprove') {
+        waf('#predictionChart').wafSection(
+          'option',
+          'onopen',
+          function (event) {
+            _private.changeBillHeight(50, false)
+          }
+        )
+        waf('#predictionChart').wafSection(
+          'option',
+          'onclose',
+          function (event) {
+            _private.changeBillHeight(50, true)
+          }
+        )
+        waf('#operateInfo').wafSection('option', 'onopen', function (event) {
+          _private.changeBillHeight(220, false)
+        })
+        waf('#operateInfo').wafSection('option', 'onclose', function (event) {
+          _private.changeBillHeight(220, true)
+        })
+        waf('#optionalSection').wafSection(
+          'option',
+          'onopen',
+          function (event) {
+            _private.changeBillHeight(60, false)
+          }
+        )
+        waf('#optionalSection').wafSection(
+          'option',
+          'onclose',
+          function (event) {
+            _private.changeBillHeight(60, true)
+          }
+        )
+      }
+    },
+    initZoomTool: function () {
+      $('#onClose').show()
+      $('#tabs_ul li')
+        .eq($('#tabs_ul li').length - 1)
+        .append($('#onClose'))
+      $('#splitPanel_LeftSplitPanel').prepend($('#onOpen'))
+      $('#onClose').bind('click', function () {
+        $('#splitPanel').height($('#splitPanel_LeftSplitPanel').height())
+        rightPanelWidth = $('#splitPanel_RightSplitPanel').width()
+        leftPanelWidth = $('#splitPanel_LeftSplitPanel').width()
+        $('#splitPanel_RightSplitPanel').css('width', '0%')
+        $('#splitPanel_LeftSplitPanel').css('width', '100%')
+        $('#onOpen').show()
+        if (riskInsight && _private.curTab == 'riskInsight') {
+          $('.billInsight_cardPanel').css('display', 'none')
+        }
+        if (approvetype == 'batchapprove' && !assign.batchApproveUrl) {
+          var newWidth = $('#queryGrid').wafGrid('getGridParentWidth')
+          $('#queryGrid').jqGrid('setGridWidth', newWidth)
+        }
+      })
+      $('#onOpen').bind('click', function () {
+        $('#onOpen').hide()
+        $('#splitPanel_RightSplitPanel').css('width', rightPanelWidth)
+        $('#splitPanel_LeftSplitPanel').css('width', leftPanelWidth)
+        if (riskInsight && _private.curTab == 'riskInsight') {
+          $('.billInsight_cardPanel').show()
+        }
+        if (approvetype == 'batchapprove' && !assign.batchApproveUrl) {
+          var newWidth = $('#queryGrid').wafGrid('getGridParentWidth')
+          $('#queryGrid').jqGrid('setGridWidth', newWidth)
+        }
+      })
+      $('#onOpen').bind('hover', function () {
+        $('#onOpen').css('opacity', 1)
+      })
+    },
+    pageOnload: function (e) {
+      $('body').ready(function () {
+        _private.supportMulti()
+        _private.showtab()
+        var billId = assign.billId
+        if (approvetype == 'approve') {
+          _private.initApprove()
+        } else {
+          if (approvetype == 'batchapprove') {
+            _private.initBatchapprove()
+            if (locationurl && locationurl.assignmentIds) {
+              var actionUrl =
+                waf.getContextPath() +
+                '/activityProperty.do?method=addAssignReadTime'
+              var params = {}
+              params.assignIds = locationurl.assignmentIds
+              waf.doPost({
+                url: actionUrl,
+                data: params,
+                async: true,
+                success: function (data) {}
+              })
             }
-            para.msgId = msgId;
-            wfCommonUtil.showBill(para)
-        },
-        messageDigest: function () {
-            var messageDigest = assign.messageDigest;
-            if (messageDigest.toString().indexOf("table") > 0) {
-                waf("#panel5").wafPanel("option", "hidden", true);
-                waf("#bill").wafSection("option", "hidden", false);
-                document.getElementById("bill_content").innerHTML = messageDigest
+          } else {
+            if (approvetype == 'manualdecision') {
+              _private.initManualdecision()
             } else {
-                waf("#billFrame").remove();
-                waf("#billAttachment").remove();
-                var billDigest = eval("(" + messageDigest + ")");
-                var options = {
-                    title: _self._localeStr.WEB_BASICINFO,
-                    id: "billBaseInfo",
-                    name: "billBaseInfo",
-                    openIconCls: "ui-section-minus",
-                    closeIconCls: "ui-section-plus",
-                    autoOpen: true,
-                    style: "margin-right: 0px;"
-                };
-                var billBaseInfo = waf.createDOM("section", options);
-                waf.appendDOM(waf("#panel5"), billBaseInfo);
-                waf.initComponent("section", options, billBaseInfo);
-                var items = billDigest.items;
-                for (var i = 0; i < items.length; i++) {
-                    var labeloptions = {
-                        id: "labelContainer" + i,
-                        caption: items[i][0],
-                        style: "width: 33%;float: left;"
-                    };
-                    var labeldom = waf.createDOM("labelContainer", labeloptions);
-                    waf("#billBaseInfo").wafSection("appendChildren", labeldom);
-                    waf.initComponent("labelContainer", labeloptions, labeldom);
-                    var txtoptions = {
-                        id: "billbase" + i,
-                        caption: items[i][1]
-                    };
-                    var textDom = waf.createDOM("label", txtoptions);
-                    labeldom.wafLabelContainer("append", textDom);
-                    waf.initComponent("label", txtoptions, textDom)
-                }
-                var entries = billDigest.entrys;
-                for (var j = 0; j < entries.length; j++) {
-                    var obj = entries[j];
-                    var billEntriesoptions = {
-                        title: obj.alias.l2,
-                        id: "billEntriesInfo" + j,
-                        name: "billEntriesInfo" + j,
-                        openIconCls: "ui-section-minus",
-                        closeIconCls: "ui-section-plus",
-                        autoOpen: true,
-                        style: "margin-right: 0px;"
-                    };
-                    var billEntriesInfo = waf.createDOM("section", billEntriesoptions);
-                    waf.appendDOM(waf("#panel5"), billEntriesInfo);
-                    waf.initComponent("section", billEntriesoptions, billEntriesInfo);
-                    if (obj.values.length > 0) {
-                        var colmodel = [];
-                        var env = obj.values[0].items;
-                        for (var m = 0; m < env.length; m++) {
-                            var para = {
-                                name: env[m][3],
-                                label: env[m][0]
-                            };
-                            colmodel.push(para)
-                        }
-                        var myGridoptions = {
-                            id: "myGrid" + j,
-                            colModel: colmodel
-                        };
-                        var dom = waf.createDOM("grid", myGridoptions);
-                        waf("#billEntriesInfo" + j).wafSection("appendChildren", dom);
-                        waf.initComponent("grid", myGridoptions, dom);
-                        var rowData = obj.values;
-                        var gridData = new Array();
-                        for (var n = 0; n < rowData.length; n++) {
-                            var rr = rowData[n].items;
-                            var rowdata = {};
-                            for (var h = 0; h < rr.length; h++) {
-                                var colname = rr[h][3];
-                                rowdata[colname] = rr[h][1]
-                            }
-                            gridData.push(rowdata)
-                        }
-                        waf("#myGrid" + j).wafGrid("addRow", {
-                            data: gridData
-                        })
-                    }
-                }
-            }
-        },
-        initMsgDigestBillAttach: function () {
-            var billAttachmentList = assign.billAttachments;
-            var billAttachmentOptions = {
-                title: _self._localeStr.WEB_ATTACHMENT,
-                id: "billAttachment",
-                name: "billAttachment",
-                openIconCls: "ui-section-minus",
-                closeIconCls: "ui-section-plus",
-                autoOpen: true,
-                style: "margin-right: 0px;"
-            };
-            var billAttachment = waf.createDOM("section", billAttachmentOptions);
-            waf.appendDOM(waf("#panel5"), billAttachment);
-            waf.initComponent("section", billAttachmentOptions, billAttachment);
-            $("#billAttachment .title").after('<span id="billAttachTitle">' + _self._localeStr.WEB_TOTALATCHMNT + "<i></i><span>" + billAttachmentList.length + "</span>个</span>");
-            var _html = "<div class='attachmentContent'><ul>";
-            for (var i = 0; i < billAttachmentList.length; i++) {
-                var row = billAttachmentList[i];
-                var simpleName = row.simpleName;
-                var classname = "file";
-                var picFormat = ["jpg", "gif", "jpeg", "png", "bmp"];
-                if (picFormat.indexOf(simpleName) > -1) {
-                    classname = "pic"
-                }
-                var judgeAttachType = "";
-                if (row.attachTypeEnum == 1) {
-                    judgeAttachType = "<span class='procAttach'>" + _self._localeStr.WEB_PROCESSATTACHMENTS + "</span>"
-                }
-                _html += '<li><div><i class="' + classname + '"></i><span class="name" title="' + row.name + "." + simpleName + '">' + judgeAttachType + row.name + "." + simpleName + '</span><span class="size">(' + row.size + ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' + row.id + '" download="' + row.name + "." + simpleName + '" target="_blank"></a>';
-                if (classname == "pic") {
-                    _html += '<i class="preview" onclick="javascript:_self.attachmentView(\'' + row.id + "','pic')\"></i>"
-                } else {
-                    if (simpleName == "pdf") {
-                        _html += '<i class="preview" onclick="javascript:_self.attachmentView(\'' + row.id + "','pdf')\"></i>"
-                    }
-                }
-                _html += "</div></li>"
+              if (approvetype == 'passComent') {
+                _private.initPassComent()
+                billId = passId
+              }
             }
-            _html += "</ul></div>";
-            return _html
-        },
-        selattachment: function (item, attcreater, beizhu) { },
-        showoperate: function (event, value) {
-            var para = {};
-            if (approvetype == "batchapprove") {
-                var assignIds = _private.getbatchid().assignIds;
-                if (assignIds.split(";").length != 1) {
-                    _self.showInfo(_self._localeStr.WEB_SELECTARECORD);
-                    return false
-                }
-                para.assignmentId = assignIds.split(";")[0]
+          }
+        }
+        _private.initSection()
+        _private.initPageLayout()
+        _private.initCalProcDiagramPanel()
+        _private.getOpinion(assign.actInstId, assign.assignId, billId)
+        _private.setsendmailormsg(
+          assign.isOpenMessageSendOnUI,
+          assign.notifyNextBySMS,
+          assign.notifyNextByMail
+        )
+        if (assign.newPage) {
+          _private.initZoomTool()
+        }
+        _private.resizePage()
+        window.scrollTo(0, 0)
+        var newTab = waf.getUrlParams(document.URL).isOpenNewTab
+        if (newTab) {
+          $('#operateInfo').css('margin', '3px 5px 5px 0')
+        }
+      })
+    },
+    initBtnNew: function () {
+      var submitBtn = waf('#submit').wafLinkButton('option', 'hidden')
+      $('#toolBar .ui-toolbar-ul').css('float', 'right')
+      if (approvetype == 'approve' || approvetype == 'batchapprove') {
+        if (approvetype == 'approve') {
+          var offset =
+            $('#panelNew1').width() - ($('#approveSaveBtn').width() * 2 + 20)
+          if (offset > 0) {
+            $('#approveSaveBtn').css('margin-left', offset / 2)
+          }
+        } else {
+          $('#approveSubmitBtn').css('float', 'right')
+        }
+        $('#toolBarNew1').show()
+        $('#panelNew1').show()
+        $('#labelapproveResult_label').hide()
+        waf('#approveSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
+        waf('#approveSaveBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#save').wafLinkButton('option', 'hidden')
+        )
+        waf('#approveDeliverBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#deliver').wafLinkButton('option', 'hidden')
+        )
+        waf('#approvePassBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#passAssignment').wafLinkButton('option', 'hidden')
+        )
+        waf('#approveKickbackBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#kickback').wafLinkButton('option', 'hidden')
+        )
+        waf('#approveAppendBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#appendActivity').wafLinkButton('option', 'hidden')
+        )
+        waf('#approveDynamicSignBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#dynamicSign').wafLinkButton('option', 'hidden')
+        )
+        waf('#approveJumpBtn').wafLinkButton(
+          'option',
+          'hidden',
+          waf('#jumpto').wafLinkButton('option', 'hidden')
+        )
+      } else {
+        if (approvetype == 'manualdecision') {
+          $('#panelNew3').show()
+          var b = waf('#deliver').wafLinkButton('option', 'hidden')
+          if (!b) {
+            $('#toolBarNew3').show()
+          }
+          waf('#decisionDeliverBtn').wafLinkButton(
+            'option',
+            'hidden',
+            waf('#deliver').wafLinkButton('option', 'hidden')
+          )
+          waf('#decisionSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
+        } else {
+          if (approvetype == 'passComent') {
+            $('#panelNew2').show()
+            var b = waf('#passAssignment').wafLinkButton('option', 'hidden')
+            if (!b) {
+              $('#toolBarNew2').show()
+            }
+            waf('#passPassBtn').wafLinkButton('option', 'hidden', b)
+            waf('#passSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
+          }
+        }
+      }
+      waf('#submit').wafLinkButton('option', 'hidden', true)
+      waf('#save').wafLinkButton('option', 'hidden', true)
+      waf('#deliver').wafLinkButton('option', 'hidden', true)
+      waf('#passAssignment').wafLinkButton('option', 'hidden', true)
+      waf('#kickback').wafLinkButton('option', 'hidden', true)
+      waf('#appendActivity').wafLinkButton('option', 'hidden', true)
+      waf('#dynamicSign').wafLinkButton('option', 'hidden', true)
+      waf('#jumpto').wafLinkButton('option', 'hidden', true)
+      if (approvetype != 'batchapprove') {
+        $('#assignTitle').show()
+        $('#assignTitle').css(
+          'width',
+          $('#toolBar').width() - $('#toolBar .ui-toolbar-ul').width()
+        )
+        $('#assignTitle').text(assign.title)
+        $('#assignTitle').prop('title', assign.title)
+      }
+    },
+    changePolicy: function (event, ui) {
+      _private.setPolicy(ui.current)
+      if (ui.current == 'false') {
+        $('#panel').hide()
+      } else {
+        $('#panel').show()
+      }
+    },
+    deliver: function (event, value) {
+      var para = {}
+      if (approvetype == 'batchapprove') {
+        para.sourceID = _private.getbatchid().assignIds
+      } else {
+        para.sourceID = assign.assignId
+      }
+      wfCommonUtil.deliverAssignment(para)
+    },
+    passAssignment: function (event, value) {
+      var para = {}
+      if (approvetype == 'batchapprove') {
+        var info = _private.getbatchid()
+        para.sourceID = info.assignIds
+        para.bizObjID = info.billIds
+      } else {
+        para.sourceID = assign.assignId
+        para.bizObjID = assign.billId
+      }
+      wfCommonUtil.passComment(para)
+    },
+    kickback: function (event, value) {
+      var assignid = ''
+      if (approvetype == 'batchapprove') {
+        assignid = _private.getbatchid().assignIds
+      } else {
+        assignid = assign.assignId
+      }
+      var url =
+        waf.getContextPath() +
+        '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.kickBackPage&assignmentId=' +
+        encodeURIComponent(assignid)
+      wfCommonUtil.windowopen(url, _self._localeStr.WEB_REJECT, 450, 320)
+    },
+    jumpto: function (event, value) {
+      var assignid = ''
+      if (approvetype == 'batchapprove') {
+        assignid = _private.getbatchid().assignIds
+      } else {
+        assignid = assign.assignId
+      }
+      var url =
+        waf.getContextPath() +
+        '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.jump&assignmentId=' +
+        encodeURIComponent(assignid)
+      wfCommonUtil.windowopen(url, _self._localeStr.WEB_JUMP, 450, 281)
+    },
+    dynamicSign: function (event, value) {
+      var assignid = ''
+      if (approvetype == 'batchapprove') {
+        assignid = _private.getbatchid().assignIds
+      } else {
+        assignid = assign.assignId
+      }
+      var url =
+        waf.getContextPath() +
+        '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.dynamicSignPage&assignmentId=' +
+        encodeURIComponent(assignid)
+      wfCommonUtil.windowopen(
+        url,
+        _self._localeStr.WEB_COUNTERSIGNPART,
+        450,
+        281
+      )
+    },
+    appendActivity: function (event, value) {
+      var billId = ''
+      var assignId = ''
+      if (approvetype == 'batchapprove') {
+        var info = _private.getbatchid()
+        assignId = info.assignIds
+        billId = info.billIds
+      } else {
+        assignId = assign.assignId
+        billId = assign.billId
+      }
+      var url =
+        waf.getContextPath() +
+        '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.appendSignPage&assignmentId=' +
+        encodeURIComponent(assignId) +
+        '&billIds=' +
+        encodeURIComponent(billId) +
+        '&isAppended=' +
+        assign.isAppended
+      if (assign.appendMode) {
+        url += '&appendMode=' + assign.appendMode[0]
+      }
+      if (assign.routeMode) {
+        url += '&routeMode=' + assign.routeMode[0]
+      }
+      wfCommonUtil.windowopen(url, _self._localeStr.WEB_COUNTERSIGN, 520, 746)
+    },
+    modifynextAct: function (event, value) {
+      _private.setmodifynextAct()
+    },
+    setselnextactperson: function (resultStr) {
+      _private.innerloadNextActs(assign.nextActs, resultStr)
+      for (var actid in resultStr) {
+        var ps = resultStr[actid]
+        var _innerhtml = _self._localeStr.WEB_SELECTED
+        var j = 0
+        if (_private.isEmptyObject(ps)) {
+          delete selnextPersons[actid]
+        } else {
+          var title = ''
+          for (var id in ps) {
+            var person = ps[id]
+            var name = person.name
+            _private.setselnextperson(actid, name, id)
+            if (j > 0) {
+              title += '、'
+            }
+            title += name
+            if (j > 2) {
+              j++
+              continue
+            }
+            if (j > 0) {
+              _innerhtml += '、'
+            }
+            _innerhtml +=
+              "<span class='persons' personid='" + id + "'>" + name + '</span>'
+            j++
+          }
+          if (j > 2) {
+            _innerhtml +=
+              _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
+          }
+          $('#' + actid).html(_innerhtml)
+          $('#' + actid).attr('title', title)
+        }
+      }
+    },
+    isEmptyObject: function (obj) {
+      for (var key in obj) {
+        return false
+      }
+      return true
+    },
+    getphrase: function () {
+      waf.doPost({
+        url:
+          waf.getContextPath() +
+          '/workflow/approve.do?method=getAppMyPhraseList',
+        success: function (data) {
+          var myPhraseList = $('#myPhraseList .showdel')
+          myPhraseList.html('')
+          for (var i = 0; i < data.length; i++) {
+            var row = $('<li></li>')
+            row.attr({ 'data-id': data[i].id, title: data[i].phraseText })
+            row.text(data[i].phraseText)
+            row.append('<i></i>')
+            myPhraseList.append(row)
+          }
+        }
+      })
+    },
+    clickPhrase: function (e) {
+      $('#myPhraseInfo li').removeClass('cur')
+      var targetElem = $(e.target)
+      targetElem.addClass('cur')
+      $('#myPhrasetext').val(targetElem.attr('title'))
+      $('#myPhrasetext').attr('data-id', targetElem.attr('data-id'))
+    },
+    dblclickPhrase: function (e) {
+      var itemval = $(e.target).attr('title')
+      $('#approveOpinion').val(itemval)
+      $('#myPhraseInfo li').removeClass('cur')
+      $('#myPhrasetext').attr('data-id', '')
+      $('#myPhrasetext').val('')
+      $('#phrasePanel').hide()
+    },
+    phrasesure: function (e) {
+      var text = $('#myPhrasetext').val()
+      if (text != null && text.length > 1000) {
+        _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG)
+        return null
+      }
+      $('#approveOpinion').val(text)
+      $('#myPhraseInfo li').removeClass('cur')
+      $('#myPhrasetext').attr('data-id', '')
+      $('#myPhrasetext').val('')
+      $('#phrasePanel').hide()
+    },
+    phraseback: function (e) {
+      $('#myPhraseInfo li').removeClass('cur')
+      $('#myPhrasetext').attr('data-id', '')
+      $('#myPhrasetext').val('')
+      $('#phrasePanel').hide()
+    },
+    myPhrase: function (event, value) {
+      $('#phrasePanel').show()
+      $('#myPhrasesection .ui-jqgrid-bdiv').css('height', 'auto')
+    },
+    addphrase: function () {
+      var text = $('#myPhrasetext').val()
+      if (text != null && text.length > 1000) {
+        _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG)
+        return null
+      }
+      var param = {}
+      var rowid = $('#myPhrasetext').attr('data-id')
+      var value = $('#myPhrasetext').val()
+      if (!value) {
+        return
+      }
+      if (rowid) {
+        param.method = 'updateOption'
+        param.opId = rowid
+        param.opName = value
+      } else {
+        param.phraseTxt = value
+        param.method = 'saveMyPhrase'
+      }
+      waf.doPost({
+        url: waf.getContextPath() + '/workflow/approve.do',
+        data: param,
+        success: function (data) {
+          _private.getphrase()
+          _self.showSuccess(_self._localeStr.WEB_ADDCOMMONCOMMENTS)
+        }
+      })
+    },
+    phrasedel: function (e) {
+      var param = {}
+      param.phraseIds = $(e.target).parent().attr('data-id')
+      $('#myPhrasetext').attr('data-id', '')
+      $('#myPhrasetext').val('')
+      waf.doPost({
+        url: waf.getContextPath() + '/workflow/approve.do?method=delMyPhrase',
+        data: param,
+        success: function (data) {
+          _private.getphrase()
+          _self.showSuccess(_self._localeStr.WEB_DELETECOMMONCOMMENTS)
+        }
+      })
+    },
+    pageOnRenderBefore: function (e) {
+      assign = _self.getPageInitData()
+      if (approvetype != 'passComent') {
+        _private.initCAConfig(assign.CAConfig)
+      }
+      var title = ''
+      if (approvetype == 'batchapprove') {
+        title = _self._localeStr.WEB_BATCHAPPROVAL
+      } else {
+        title = assign.title
+      }
+      _self.changeTitle(title)
+    },
+    phraseadd: function (e) {
+      var datarow = { phraseText: '' }
+      waf('#myPhrasegrid').wafGrid('addRow', { data: datarow })
+    },
+    viewProcessDiagram: function (event, value) {
+      var para = {}
+      if (approvetype == 'batchapprove') {
+        var assignIds = _private.getbatchid().assignIds
+        if (assignIds.split(';').length != 1) {
+          _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
+          return false
+        }
+        para.sourceID = assignIds.split(';')[0]
+      } else {
+        para.sourceID = assign.assignId
+      }
+      wfCommonUtil.viewProcessDiagram(para)
+    },
+    reloadTranId: function () {
+      var approveResult = waf('#approveResult').wafRadioGroup('getValue')
+      var policy = waf('#policy').wafSelect('getValue')
+      var ispass
+      if (approveResult == 'false') {
+        ispass = false
+      } else {
+        if (approveResult == 'true') {
+          ispass = true
+        }
+      }
+      if (assign) {
+        var approveValueStr = assign.approveValue
+        if (approveValueStr == null || approveValueStr == '') {
+          approveValueStr =
+            '0;' +
+            _self._localeStr.WEB_AGREE +
+            ';' +
+            _self._localeStr.WEB_AGREE +
+            ';:1;' +
+            _self._localeStr.WEB_DISAGREE +
+            ';' +
+            _self._localeStr.WEB_DISAGREE +
+            ';'
+        }
+        var strs = approveValueStr.split(':')
+        for (var i = 0; i < strs.length; i++) {
+          var strTemp = strs[i].split(';')
+          if (strTemp.length != 4) {
+            continue
+          }
+          if (ispass && policy == strTemp[0]) {
+            transId = strTemp[3]
+            return
+          }
+        }
+      }
+    },
+    changeselPolicy: function (event, ui) {
+      _private.reloadTranId()
+      if (waf(nextActIndex).wafCheckbox('isChecked')) {
+        _private.loadNextActs()
+      }
+    },
+    getnextacts: function () {
+      var param = {}
+      param.assignId = assign.assignId
+      param.associatedLine = transId
+      param.isPredict = _private.isPredict
+      param.isNewProcessCenter = true
+      waf.doPost({
+        url:
+          waf.getContextPath() + '/common/tree.do?method=findPostParticipants',
+        data: param,
+        async: false,
+        success: function (data) {
+          assign.nextActs = data
+        }
+      })
+    },
+    showtab: function () {
+      if (approvetype == 'approve' || approvetype == 'batchapprove') {
+        $('#tabs').wafTabs('remove', '#manualdecision')
+        $('#tabs').wafTabs('remove', '#passComent')
+      } else {
+        if (approvetype == 'manualdecision') {
+          $('#tabs').wafTabs('remove', '#approveTask')
+          $('#tabs').wafTabs('remove', '#passComent')
+        } else {
+          if (approvetype == 'passComent') {
+            $('#tabs').wafTabs('remove', '#approveTask')
+            $('#tabs').wafTabs('remove', '#manualdecision')
+          }
+        }
+      }
+      if (approvetype != 'approve') {
+        waf('#riskInsight').wafTab('remove')
+      }
+    },
+    setmanualdecision: function () {
+      var items = assign.decisionItems
+      var opinions = assign.decisionOpinions
+      var _html = ''
+      var itemArr = items.split(';')
+      var opinionArr = new Array()
+      if (!opinions) {
+        var opinionItem = ''
+        for (var i = 0; i < itemArr.length; i++) {
+          opinionItem += i + 1
+          if (i < itemArr.length - 1) {
+            opinionItem += ';'
+          }
+          opinionArr.push(i + 1)
+        }
+        assign.decisionOpinions = opinionItem
+      } else {
+        opinionArr = opinions.split(';')
+      }
+      var json = []
+      for (var i = 0; i < itemArr.length; i++) {
+        var name = itemArr[i]
+        var val = opinionArr[i]
+        var para = {}
+        para.value = val + '_' + i
+        para.alias = name
+        json.push(para)
+      }
+      waf('#radioDecision').wafRadioGroup('setItems', null, json)
+      waf('#radioDecision').wafRadioGroup('setValue', json[0].value)
+    },
+    nextActs: function (event, ui) {
+      _private.shownextActs('modifynextAct1', ui)
+    },
+    nextAct: function (event, ui) {
+      _private.shownextActs('modifynextAct', ui)
+    },
+    modifynextActs: function (event, value) {
+      _private.setmodifynextAct()
+    },
+    setmodifynextAct: function () {
+      var jsonval = ''
+      if (selnextPersons == null || selnextPersons.length == 0) {
+        jsonval = ''
+      } else {
+        jsonval = JSON.stringify(selnextPersons)
+      }
+      waf.window.open({
+        url:
+          waf.getContextPath() +
+          '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.setNextAct&debug=true&assignmentId=' +
+          encodeURIComponent(assign.assignId) +
+          '&selnextPersons=' +
+          encodeURIComponent(jsonval) +
+          '&asso=' +
+          transId +
+          '&isPredict=' +
+          _private.isPredict,
+        openType: 'iframe',
+        method: 'POST',
+        data: {},
+        modal: true,
+        title: _self._localeStr.WEB_NEXTACTIVITY,
+        position: 'center',
+        width: 1020,
+        height: 580,
+        minHeight: 560,
+        minWidth: 1020,
+        iconCls: 'waf-ui-icon',
+        draggable: true,
+        resizable: true,
+        close: function (event, ui) {},
+        retValCallBack: function (resultData) {
+          if (
+            resultData &&
+            resultData.resultStr &&
+            resultData.resultStr.length > 0
+          ) {
+            var resultStr = JSON.parse(resultData.resultStr)
+            selnextPersons = {}
+            _private.isPredict = resultData.isPredict
+            _private.setselnextactperson(resultStr)
+          }
+        }
+      })
+    },
+    getbatchlist: function () {
+      if (assign.batchApproveUrl) {
+        var url =
+          waf.getContextPath() +
+          assign.batchApproveUrl +
+          '&hasToolbar=false&showCommonQuery=false'
+        var billIds = locationurl.billIds.split(';')
+        var temp = 'id%20in%20('
+        for (var i = 0; i < billIds.length; i++) {
+          if (billIds[i]) {
+            if (i == 0) {
+              temp += '%27' + encodeURIComponent(billIds[i]) + '%27'
             } else {
-                para.assignmentId = assign.assignId
+              temp += '%2C%27' + encodeURIComponent(billIds[i]) + '%27'
             }
-            if (wfCommonUtil.getOperationRecordsPerm(para.assignmentId)) {
-                wfCommonUtil.showApproveDetail(para)
+          }
+        }
+        temp += ')'
+        $(
+          "<form id='framesrcbillform' method='POST' type='hidden' target='billFrame' action='" +
+            url +
+            "'></form>"
+        )
+          .insertAfter($('#billFrame'))
+          .append(
+            $("<input type='hidden' name='filterInfo' value='" + temp + "'>")
+          )
+          .append(
+            $("<input type='hidden' name='botpFilter' value='" + temp + "'>")
+          )
+        setTimeout(function () {
+          document.getElementById('framesrcbillform').submit()
+        }, 500)
+        var times = 0
+        var interval = setInterval(function () {
+          var frame = document.getElementById('billFrame')
+          $($(frame)[0].contentDocument.body)
+            .find('.ui-jqgrid')
+            .css({ margin: '0px', width: '100%' })
+          if (times > 600) {
+            clearInterval(interval)
+          }
+          times++
+        })
+      } else {
+        waf('#billFrame').remove()
+        var listinfo = {}
+        waf.doPost({
+          url:
+            waf.getContextPath() +
+            '/workflow/approve.do?method=getBatchApproveBillGrid',
+          data: { billIds: locationurl.billIds },
+          async: false,
+          success: function (data) {
+            listinfo = data
+          }
+        })
+        var headers = listinfo.headers
+        var list = listinfo.list
+        var fields = listinfo.fields
+        if (headers.length > 0) {
+          var colmodel = []
+          var paraid = { name: 'id', label: 'id', hidden: true, key: true }
+          colmodel.push(paraid)
+          for (var m = 0; m < headers.length; m++) {
+            var para = { name: fields[m], label: headers[m] }
+            colmodel.push(para)
+          }
+          var myGridoptions = {
+            id: 'queryGrid',
+            colModel: colmodel,
+            multiselect: true,
+            loadInit: false,
+            shrinkToFit: true
+          }
+          if (headers.length > 15) {
+            myGridoptions.shrinkToFit = false
+          }
+          var dom = waf.createDOM('grid', myGridoptions)
+          waf.appendDOM(waf('#panel5'), dom)
+          waf.initComponent('grid', myGridoptions, dom)
+          for (var i = 0; i < list.length; i++) {
+            for (var j in list[i]) {
+              if (list[i][j] != null && typeof list[i][j] == 'object') {
+                list[i][j] = list[i][j].alias
+              }
+            }
+            waf('#queryGrid').wafGrid('addRow', { data: list[i] })
+          }
+        }
+      }
+    },
+    shownextActs: function (nextactname, ui) {
+      if (ui.checked) {
+        $('.approve-next-persons').show()
+        _private.loadNextActs()
+      } else {
+        $('.approve-next-persons').hide()
+        waf('#' + nextactname).wafLinkButton('option', 'hidden', true)
+        selnextPersons = {}
+      }
+    },
+    submit: function (event, value) {
+      if (approvetype == 'approve') {
+        _private.confirmSumit('beforeInnerSubmit')
+      } else {
+        if (approvetype == 'manualdecision') {
+          _private.manualdecisionsubmit()
+        } else {
+          if (approvetype == 'batchapprove') {
+            _private.confirmSumit('batchSubmitForCA')
+          } else {
+            if (approvetype == 'passComent') {
+              _private.passComentsubmit()
+            }
+          }
+        }
+      }
+    },
+    confirmSumit: function (funcName) {
+      if (assign.enableMultiapproveConfirm == 'true') {
+        var ok = function () {
+          _private[funcName]()
+        }
+        var cancel = function () {
+          return
+        }
+        waf.msgBox.showConfirm({
+          title: _self._localeStr.WEB_MESSPROMPT,
+          summaryMsg: _self._localeStr.WEB_CONFIRMSUBMITAPPROVAL,
+          buttonType: 'ok-cancel',
+          buttonCallBack: [ok, cancel]
+        })
+      } else {
+        _private[funcName]()
+      }
+    },
+    passComentsubmit: function () {
+      var params = {}
+      params.parameter = sourceIDs
+      params.chksendMessage = 'yes'
+      if (waf('#sendmsgs').wafCheckbox('isChecked')) {
+        params.chksendMobile = 'yes'
+      }
+      if (waf('#sendmails').wafCheckbox('isChecked')) {
+        params.chksendMail = 'yes'
+      }
+      params.opinion = $('#passComentOpinion').val()
+      var option = $('#passComentOpinion').val()
+      if (option != null && option.length > 1000) {
+        _self.showInfo(_self._localeStr.WEB_FEEDBACKCOMMENTS_TOOLONG)
+        return null
+      }
+      waf.doPost({
+        url: waf.getContextPath() + '/passComment/get.do?method=commit',
+        data: params,
+        success: function (data) {
+          _self.showSuccess(_self._localeStr.WEB_DEEDBACKCIRCULATESUCCESS)
+          _private.backto()
+        }
+      })
+    },
+    initCAConfig: function (tCAConfig) {
+      caConfig.caConfigInfo = tCAConfig
+      if (
+        caConfig.caConfigInfo.isSignatureApprove === 'true' &&
+        caConfig.caConfigInfo.caType != '5'
+      ) {
+        var initflag = initTopesa()
+        if (initflag != 0) {
+          waf.msgBox.showError(_self._localeStr.WEB_CAINITFAILED)
+        }
+      }
+    },
+    batchSubmitForCA: function () {
+      if (
+        caConfig.caConfigInfo.checkPassword === 'true' &&
+        caConfig.caConfigInfo.isSignatureApprove === 'true' &&
+        caConfig.caConfigInfo.caType != '5'
+      ) {
+        _private.checkCAPassword(true)
+      } else {
+        _private.batchSubmit()
+      }
+    },
+    checkCAPassword: function (isBatch) {
+      var setcss = function () {
+        var item = parent.$('.ui-msgbox .ui-prompt .prompt')
+        if ($(item)) {
+          $(item).css({
+            height: '78px',
+            margin: '20px 0 20px 190px',
+            background:
+              'url(/easweb/webviews/workflow/img/waitpic.png) no-repeat'
+          })
+        }
+      }
+      setTimeout(setcss, 100)
+      var prmt = function (r, dialog) {
+        if (r) {
+          var res = -1
+          try {
+            res = checkPassword(r, caConfig.caConfigInfo.userName)
+          } catch (errMsg) {
+            _self.showInfo(
+              _self._localeStr.WEB_USBKEYCHECKPASSDETAIL + errMsg.message
+            )
+            return false
+          }
+          if (res != 0) {
+            _self.showInfo(_self._localeStr.WEB_USBKEYCHECKPASS)
+          } else {
+            if (isBatch) {
+              _private.batchSubmit()
             } else {
-                waf.msgBox.showInfo({
-                    title: _self._localeStr.WEB_MESSAGEALERT,
-                    summaryMsg: _self._localeStr.WEB_FORBIDVIEW
-                });
-                $(".ui-msgbox .content").width("330px")
+              _private.innerSubmit()
             }
-        },
-        esignatureOnClick: function (event, ui) {
-            if (ui.checked) {
-                $("#esigndiv").show()
+          }
+        }
+      }
+      var cancel = function () {
+        return
+      }
+      waf.msgBox.showPrompt({
+        title: _self._localeStr.WEB_MESSPROMPT,
+        icon: 'prompt',
+        summaryMsg: _self._localeStr.WEB_INPUTUSBKEYPASSWORD,
+        buttonCallBack: [prmt, cancel]
+      })
+      parent.$('#waf-messageBox-prompt-input').prop('type', 'password')
+    },
+    batchSubmit: function () {
+      var info = _private.getbatchid()
+      if (info == null) {
+        return
+      }
+      _private._batchsubmit(info)
+    },
+    getbatchid: function () {
+      var info = {}
+      var assignIds = ''
+      var billIds = ''
+      var allbillIds = locationurl.billIds
+      var allassignmentIds = locationurl.assignmentIds
+      if (assign.batchApproveUrl) {
+        var frame = document.getElementById('billFrame')
+        billIds = $(frame)[0]
+          .contentWindow.waf('#queryGrid')
+          .dataGrid('getSelectedRows')
+      } else {
+        billIds = waf('#queryGrid').wafGrid('getSelectedRows')
+      }
+      if (billIds.length == 0) {
+        billIds = allbillIds
+        assignIds = allassignmentIds
+      } else {
+        for (var i = 0; i < allbillIds.split(';').length; i++) {
+          var allbillId = allbillIds.split(';')[i]
+          if (billIds.toString().indexOf(allbillId) > -1) {
+            if (assignIds != '') {
+              assignIds += ';'
+            }
+            assignIds += allassignmentIds.split(';')[i]
+          }
+        }
+        billIds = billIds.join(';')
+      }
+      info.billIds = billIds
+      info.assignIds = assignIds
+      return info
+    },
+    _batchsubmit: function (info) {
+      var approve = _private.getApprove()
+      if (!approve) {
+        return
+      }
+      var billIds = info.billIds
+      var assignIds = info.assignIds
+      approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove
+      if (
+        caConfig.caConfigInfo.isSignatureApprove === 'true' &&
+        caConfig.caConfigInfo.caType != '5'
+      ) {
+        if (!_private.beforeBatchSubmitSigature(billIds)) {
+          return
+        }
+        approve.plainTextMap = caConfig.plainTextMap
+        approve.plainSignatureMap = caConfig.plainSignatureMap
+      }
+      var nextPersons = _private.getNextPersons()
+      if (!nextPersons) {
+        return
+      }
+      var ok = function () {
+        var params = {}
+        approve.nextActs = nextPersons
+        params.approve = JSON.stringify(approve)
+        params.assignIds = assignIds
+        params.billIds = billIds
+        waf.doPost({
+          url: waf.getContextPath() + '/common/tree.do?method=batchSubmits',
+          data: params,
+          success: function (data) {
+            if (data == 'OK') {
+              _self.showSuccess(_self._localeStr.WEB_BATCHAPPROVESUCCESS)
+              _private.backto()
             } else {
-                $("#esigndiv").hide()
+              _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
+            }
+          }
+        })
+      }
+      var cancel = function () {
+        return
+      }
+      if (showerror != '') {
+        waf.msgBox.showConfirm({
+          title: _self._localeStr.WEB_MESSPROMPT,
+          summaryMsg: showerror,
+          buttonType: 'ok-cancel',
+          buttonCallBack: [ok, cancel]
+        })
+      } else {
+        ok()
+      }
+    },
+    getApprove: function () {
+      var opinion = waf('#approveOpinion').val()
+      if (
+        assign.needApproveOpinion &&
+        (opinion == null || opinion.trim() == '')
+      ) {
+        _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSNOBLANK)
+        return null
+      }
+      if (opinion != null && opinion.length > 1000) {
+        _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSTOOLONG)
+        return null
+      }
+      var ispass = null
+      var approveResult = waf('#approveResult').wafRadioGroup('getValue')
+      if (approveResult == 'false') {
+        ispass = 'false'
+        if (assign.mustFillOpinionWhenDisagree == 'true') {
+          if (
+            opinion == null ||
+            opinion.trim() == '' ||
+            opinion == _self._localeStr.WEB_DISAGREE
+          ) {
+            _self.showInfo(_self._localeStr.WEB_DISAGREEOPINION)
+            return null
+          }
+        }
+      } else {
+        if (approveResult == 'true') {
+          ispass = 'true'
+        }
+      }
+      var approve = {}
+      approve.assignId = assign.assignId
+      approve.id = assign.id
+      approve.opinion = opinion
+      var handlerOpinion = waf('#policy').wafSelect('getValue')
+      if (handlerOpinion) {
+        approve.handlerOpinion = handlerOpinion
+      } else {
+        approve.handlerOpinion = '0'
+      }
+      approve.handlerContent = waf('#policy').wafSelect('getSelectedAlias')
+      approve.approveResult = ispass
+      approve.transitionId = transId
+      approve.isSendSMS = waf('#sendmsg').wafCheckbox('isChecked')
+        ? 'true'
+        : 'false'
+      approve.isSendMail = waf('#sendmail').wafCheckbox('isChecked')
+        ? 'true'
+        : 'false'
+      if (assign.multiapproveinfoId) {
+        approve.id = assign.multiapproveinfoId
+      }
+      var isesignaturecheck = false
+      if (approvetype == 'approve' || approvetype == 'batchapprove') {
+        isesignaturecheck = waf('#esignature').wafCheckbox('isChecked')
+      } else {
+        if (approvetype == 'manualdecision') {
+          isesignaturecheck = waf('#esignature1').wafCheckbox('isChecked')
+        }
+      }
+      if (assign.isEsignature && isesignaturecheck) {
+        approve.esignatureid = assign.esignatureId
+      }
+      return approve
+    },
+    beforeBatchSubmitSigature: function (selectBillIds) {
+      var modelIDs = ''
+      var tbillIDs
+      if (Object.prototype.toString.call(selectBillIds) === '[object Array]') {
+        tbillIDs = selectBillIds
+      } else {
+        tbillIDs = selectBillIds.split(';')
+      }
+      for (var i = 0; i < tbillIDs.length; i++) {
+        if (modelIDs != '') {
+          modelIDs += ','
+        }
+        modelIDs += tbillIDs[i]
+      }
+      if (modelIDs === undefined || modelIDs == null || modelIDs === '') {
+        waf.msgBox.showError("bill id can't be null")
+        return false
+      }
+      var actionUrl =
+        waf.getContextPath() +
+        '/component/ca.do?method=getPlainTextFromDB&billIDs=' +
+        waf.encodeURIComponent(modelIDs) +
+        '&isFromWF=true'
+      waf.doPost({
+        url: actionUrl,
+        async: false,
+        success: function (data) {
+          if (data == null || data == '' || data == undefined) {
+            return false
+          } else {
+            caConfig.plainTextMap = data.plainTextMap
+          }
+        },
+        error: function (data) {
+          waf.msgBox.showError('getPlainTextFromDB failed')
+          return false
+        }
+      })
+      var arraySignature = ''
+      var billids = modelIDs.split(',')
+      for (var i = 0; i < billids.length; i++) {
+        var key = billids[i]
+        var signResult = -1
+        try {
+          signResult = signMessage(
+            caConfig.plainTextMap[key],
+            caConfig.caConfigInfo.userName
+          )
+        } catch (errMsg) {
+          _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message)
+          return false
+        }
+        if (signResult == 1 || signResult == 2 || signResult == 3) {
+          if (signResult == 1 || signResult == 2) {
+            _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY)
+          }
+          return false
+        }
+        if (arraySignature != '') {
+          arraySignature += ','
+        }
+        arraySignature += signResult
+      }
+      caConfig.plainSignatureMap = arraySignature
+      return true
+    },
+    getNextPersons: function (isSave) {
+      var locale = waf.getContext().locale
+      var symbol = '。'
+      if (locale == 'l1') {
+        symbol = '.'
+      }
+      showerror = ''
+      var nextPersons = []
+      var ispass = waf('#approveResult').wafRadioGroup('getValue')
+      if (ispass == 'false') {
+        return nextPersons
+      }
+      var isnextact = waf(nextActIndex).wafCheckbox('isChecked')
+      var directActName = ''
+      if (isnextact) {
+        var num = 0
+        var index = 0
+        var directCount = 0
+        var directIsSel = false
+        for (var i = 0; i != assign.nextActs.length; i++) {
+          if (_private.isPredict && !assign.nextActs[i].isPredict) {
+            continue
+          }
+          var act = {}
+          act.actKey = assign.nextActs[i].actKey
+          act.persons = {}
+          var flag = false
+          directCount++
+          for (var actId in selnextPersons) {
+            if (actId == assign.nextActs[i].actId) {
+              var persons = selnextPersons[actId]
+              for (var id in persons) {
+                act.persons[id] = 'true'
+                flag = true
+              }
+            }
+          }
+          if (directCount == 1) {
+            directIsSel = flag
+          }
+          if (!flag) {
+            if (num < 3) {
+              if (showerror != '') {
+                showerror += '、'
+              }
+              showerror += assign.nextActs[i].actName
+            }
+            num++
+            if (num == 1) {
+              directActName = assign.nextActs[i].actName
+            }
+          } else {
+            nextPersons[index] = act
+            index++
+          }
+        }
+        if (num > 0) {
+          if (num > 2) {
+            showerror +=
+              _self._localeStr.WEB_ANDSOON + num + _self._localeStr.WEB_NODE
+          }
+          if (!isSave && assign.mustSetAllNextPerson) {
+            _self.showInfo(
+              _self._localeStr.WEB_NEXTACTIVITY + ':' + showerror + symbol
+            )
+            return null
+          }
+          if (
+            !isSave &&
+            assign.mustSetAllNextPersonDirectNull &&
+            !directIsSel
+          ) {
+            _self.showInfo(
+              _self._localeStr.WEB_NEXTACTIVITY + ':' + directActName + symbol
+            )
+            return null
+          }
+          showerror += _self._localeStr.WEB_NOPARTICIPANTSUBMIT
+        }
+      }
+      return nextPersons
+    },
+    manualdecisionsubmit: function () {
+      var selectValue = waf('#radioDecision').wafRadioGroup('getValue')
+      if (selectValue) {
+        var selItems = $(
+          "#radioDecision input[value='" + selectValue + "']"
+        ).next()[0].innerHTML
+        var params = {}
+        var nextPersons = _private.getNextPersons()
+        if (!nextPersons) {
+          return
+        }
+        var ok = function () {
+          nextPersons = JSON.stringify(nextPersons)
+          params.nextperson = nextPersons
+          params.assignId = assign.assignId
+          params.decisionTitle = assign.decisionName
+          params.decisionItems = assign.decisionItems
+          params.decisionDesc = assign.decisionDesc
+          params.decisionOpinions = assign.decisionOpinions
+          params.SelectedItems = selItems
+          params.SelectedOpinions = selectValue.substr(
+            0,
+            selectValue.indexOf('_')
+          )
+          waf.doPost({
+            url:
+              waf.getContextPath() + '/manualdecision/submit.do?method=submit',
+            data: params,
+            success: function (data) {
+              _self.showSuccess(_self._localeStr.WEB_DECISIONSUBMITSUCCESS)
+              _private.backto()
+            }
+          })
+        }
+        var cancel = function () {
+          return
+        }
+        if (showerror != '') {
+          waf.msgBox.showConfirm({
+            title: _self._localeStr.WEB_MESSPROMPT,
+            summaryMsg: showerror,
+            buttonType: 'ok-cancel',
+            buttonCallBack: [ok, cancel]
+          })
+        } else {
+          ok()
+        }
+      }
+    },
+    beforeInnerSubmit: function () {
+      if (
+        caConfig.caConfigInfo.checkPassword === 'true' &&
+        caConfig.caConfigInfo.isSignatureApprove === 'true' &&
+        caConfig.caConfigInfo.caType != '5'
+      ) {
+        _private.checkCAPassword(false)
+      } else {
+        _private.innerSubmit()
+      }
+    },
+    innerSubmit: function () {
+      if (
+        assign.mustUploadAttachment &&
+        waf('#approveResult').wafRadioGroup('getValue') == 'true'
+      ) {
+        var isCurAssignUploadAttach = false
+        waf.doPost({
+          url:
+            waf.getContextPath() +
+            '/iwebattachment.do?method=isCurAssignUploadAttach',
+          data: { assignId: assign.assignId },
+          async: false,
+          success: function (data) {
+            if (data == false) {
+              _self.showWarning(_self._localeStr.WEB_MUSTUPLOAD)
+            }
+            isCurAssignUploadAttach = data
+          }
+        })
+        if (!isCurAssignUploadAttach) {
+          return
+        }
+      }
+      assign.operation = 'approve'
+      var callback = function (isSuccess) {
+        if (isSuccess) {
+          _private._submit(false)
+        }
+      }
+      var issubmit = _private.checkIsSave(callback, 'submit')
+      if (issubmit == null) {
+        _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND)
+        return false
+      }
+      _private._submit(issubmit)
+    },
+    _submit: function (isReadOnly) {
+      var approve = _private.getApprove()
+      if (!approve) {
+        return
+      }
+      var nextPersons = _private.getNextPersons()
+      if (!nextPersons) {
+        return
+      }
+      var ok = function () {
+        approve.operation = assign.operation
+        var op = approve.operation
+        if (
+          caConfig.caConfigInfo.isSignatureApprove === 'true' &&
+          caConfig.caConfigInfo.caType != '5'
+        ) {
+          if (!_private.beforeSubmitSigature()) {
+            return
+          }
+          approve.plainText = caConfig.CA_plainText
+          approve.signature = caConfig.CA_signature
+        }
+        if (
+          isReadOnly === undefined ||
+          isReadOnly === null ||
+          isReadOnly === ''
+        ) {
+          isReadOnly = true
+        }
+        if (!isReadOnly) {
+          var frame = document.getElementById('billFrame')
+          if (
+            frame.contentDocument.getElementById('frame_tab_0') != null &&
+            frame.contentDocument.getElementById('frame_tab_0') != undefined
+          ) {
+            frame = frame.contentDocument.getElementById('frame_tab_0')
+          }
+          if (frame.contentWindow._self.getCurrentModel) {
+            var modelInfo = frame.contentWindow._self.getCurrentModel()
+            var editModel = JSON.stringify(modelInfo)
+            approve.model = editModel
+          }
+          if (approve.model == null) {
+            if (frame.contentWindow._self.fireEvent) {
+              var s = frame.contentWindow._self.fireEvent('save')
+              if (!s) {
+                return false
+              }
             }
-        },
-        isWaf1Bill: function (url) { },
-        jMessageAlert: function (message) {
-            _self.showInfo(message)
-        },
-        onselect: function (event, ui) {
-            if (riskInsight) {
-                if (ui.panel.id == "riskInsight") {
-                    waf("#billInsight").billInsight("intelligentInspection", billInsightOption.list);
-                    waf("body").unbind("click");
-                    $(".billInsight_cardPanel").draggable("disable");
-                    _private.updateBillInsightNum(billInsightOption);
-                    _private.resizeBillInsight(false);
-                    _private.curTab = "riskInsight"
+          }
+        }
+        approve.isReadOnly = isReadOnly.toString()
+        approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove
+        approve.nextActs = nextPersons
+        if ($('#textCC').prop('personIds')) {
+          approve.ccPersonIds = $('#textCC').prop('personIds')
+        }
+        var params = {}
+        params.approve = JSON.stringify(approve)
+        waf.doPost({
+          url: waf.getContextPath() + '/common/tree.do?method=submits',
+          data: params,
+          success: function (data) {
+            if (data) {
+              assign.id = data
+              _self.showSuccess(_self._localeStr.WEB_SUBMITSUCCESS)
+              _private.backto()
+            } else {
+              _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
+            }
+          }
+        })
+      }
+      var cancel = function () {
+        return
+      }
+      if (showerror != '') {
+        waf.msgBox.showConfirm({
+          title: _self._localeStr.WEB_MESSPROMPT,
+          summaryMsg: showerror,
+          buttonType: 'ok-cancel',
+          buttonCallBack: [ok, cancel]
+        })
+      } else {
+        ok()
+      }
+    },
+    beforeSubmitSigature: function () {
+      var plainText = ''
+      var signatureField = caConfig.caConfigInfo.signatureFields
+      if (signatureField === null || signatureField === '') {
+        return true
+      }
+      var signatureFields = signatureField.split(';')
+      for (var i = 0; i < signatureFields.length; i++) {
+        var srcValue = 'CANOTSIGNATURE'
+        try {
+          srcValue = eval(
+            "document.getElementById('billFrame').contentWindow.document.getElementsByName('" +
+              signatureFields[i] +
+              "')[0].value"
+          )
+        } catch (e) {
+          srcValue = 'CANOTSIGNATURE'
+        }
+        if (typeof srcValue == 'undefined') {
+          srcValue = 'CANOTSIGNATURE'
+        }
+        if (
+          caConfig.caConfigInfo.precisionInfo &&
+          caConfig.caConfigInfo.precisionInfo[signatureFields[i]]
+        ) {
+          var pos = parseInt(
+            caConfig.caConfigInfo.precisionInfo[signatureFields[i]]
+          )
+          if (pos < 0) {
+            pos = 2
+          } else {
+            if (pos > 4) {
+              pos = 4
+            }
+          }
+          srcValue = _private.toDecimal(srcValue, pos)
+        }
+        plainText = plainText + srcValue
+      }
+      var signResult = -1
+      try {
+        signResult = signMessage(plainText, caConfig.caConfigInfo.userName)
+      } catch (errMsg) {
+        _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message)
+        return false
+      }
+      if (signResult == 1 || signResult == 2 || signResult == 3) {
+        if (signResult == 1 || signResult == 2) {
+          _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY)
+          return false
+        }
+      } else {
+        caConfig.CA_plainText = plainText
+        caConfig.CA_signature = signResult
+      }
+      return true
+    },
+    toDecimal: function (src, pos) {
+      var f = parseFloat(src)
+      if (isNaN(f)) {
+        return false
+      }
+      var src_rs = src.indexOf('.')
+      if (src_rs > 0) {
+        var src_zero = src.lastIndexOf('0')
+        while (src.length == src_zero + 1) {
+          src = src.substring(0, src_zero)
+          src_zero = src.lastIndexOf('0')
+        }
+        if (src.length == src_rs + 1) {
+          var src_int = src.substring(0, src_rs)
+          src = src_int
+        }
+        if (pos == 0) {
+          return src
+        }
+      }
+      var f = Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos)
+      var s = f.toString()
+      var rs = s.indexOf('.')
+      if (rs < 0 && pos > 0) {
+        rs = s.length
+        s += '.'
+      }
+      while (s.length <= rs + pos) {
+        s += '0'
+      }
+      return s
+    },
+    save: function (event, value) {
+      var callback = function (isSuccess) {
+        if (isSuccess) {
+          _private._save()
+        }
+      }
+      var issubmit = _private.checkIsSave(callback, 'save')
+      if (issubmit == 'callBack') {
+        return
+      }
+      if (issubmit == null) {
+        _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND)
+        return false
+      }
+      _private._save(issubmit)
+      if (!issubmit && riskInsight) {
+        billInsightOption = _private.getWeakRisk()
+        _private.updateBillInsightNum(billInsightOption)
+      }
+    },
+    checkIsSave: function (callback, type) {
+      var issubmit = null
+      if (!assign.billIsReadOnly) {
+        if (
+          type == 'submit' &&
+          assign.disagreenotsave &&
+          waf('#approveResult').wafRadioGroup('getValue') == 'false'
+        ) {
+          return true
+        }
+        var frame = document.getElementById('billFrame')
+        if (frame) {
+          if (
+            frame.contentWindow._self &&
+            frame.contentWindow._self.saveAndCallBack
+          ) {
+            frame.contentWindow._self.saveAndCallBack(callback)
+            return 'callBack'
+          } else {
+            var canSaveBill = false
+            var haveChangeBill = null
+            var contentWindowSelf = null
+            if (frame.contentWindow._self) {
+              contentWindowSelf = frame.contentWindow._self
+            } else {
+              if (
+                frame.contentDocument.getElementById('frame_tab_0') &&
+                frame.contentDocument.getElementById('frame_tab_0')
+                  .contentWindow._self
+              ) {
+                contentWindowSelf =
+                  frame.contentDocument.getElementById('frame_tab_0')
+                    .contentWindow._self
+              }
+            }
+            if (contentWindowSelf) {
+              var WFBizSubmitCheckPriority = false
+              if (contentWindowSelf.isWFBizSubmitCheckPriority) {
+                WFBizSubmitCheckPriority =
+                  contentWindowSelf.isWFBizSubmitCheckPriority()
+              }
+              if (WFBizSubmitCheckPriority) {
+                if (contentWindowSelf.fireEvent) {
+                  haveChangeBill = contentWindowSelf.fireEvent(
+                    'judgeDataModifyActionEvent',
+                    ['workflow']
+                  )
                 } else {
-                    $(".billInsight_cardPanel").css("display", "none");
-                    _private.curTab = ""
+                  if (contentWindowSelf.checkBillDataChanges) {
+                    haveChangeBill = contentWindowSelf.checkBillDataChanges()
+                  }
                 }
-            }
-        },
-        resizeBillInsight: function (windowResize) {
-            var top = $("#li_approveTask").offset().top + 44;
-            var left = $("#li_approveTask").offset().left;
-            if (!windowResize) {
-                left += 10
-            }
-            var width = $("#tabs_ul").width();
-            var t = $(".ui-cardPanel").attr("style") + "width:" + width + "px !important";
-            $(".billInsight_cardPanel").css("cssText", t);
-            $(".billInsight_cardPanel").css({
-                top: top,
-                left: left
-            });
-            $(".ui-cardPanel .noRecords,.ui-cardPanel .noRecordsImage,.ui-cardPanel .noRecordsText").css({
-                width: "100%",
-                margin: "0px",
-                "min-width": "160px"
-            })
-        },
-        getWeakRisk: function () {
-            var urlParams = waf.getUrlParam(assign.billEditUrl);
-            var billId = urlParams.billId;
-            var uipk = urlParams.uipk;
-            var billInsightOption = {};
-            waf.doPost({
-                async: false,
-                url: waf.getContextPath() + "/risk/ForWebController.do?method=getWeakRisk",
-                data: {
-                    uipk: uipk,
-                    id: billId,
-                    riskIds: assign.riskInsight
-                },
-                success: function (data) {
-                    if (data != null) {
-                        billInsightOption = data
-                    }
+                if (contentWindowSelf.beforeSubmit) {
+                  canSaveBill = contentWindowSelf.beforeSubmit()
+                } else {
+                  if (contentWindowSelf.fireEvent) {
+                    canSaveBill =
+                      contentWindowSelf.fireEvent('fieldOnStoreEvent') &&
+                      contentWindowSelf.fireEvent('submitBeforeActionEvent')
+                  }
+                }
+              } else {
+                if (contentWindowSelf.beforeSubmit) {
+                  canSaveBill = contentWindowSelf.beforeSubmit()
+                } else {
+                  if (contentWindowSelf.fireEvent) {
+                    canSaveBill =
+                      contentWindowSelf.fireEvent('fieldOnStoreEvent') &&
+                      contentWindowSelf.fireEvent('submitBeforeActionEvent')
+                  }
+                }
+                if (contentWindowSelf.fireEvent) {
+                  haveChangeBill = contentWindowSelf.fireEvent(
+                    'judgeDataModifyActionEvent',
+                    ['workflow']
+                  )
+                } else {
+                  if (contentWindowSelf.checkBillDataChanges) {
+                    haveChangeBill = contentWindowSelf.checkBillDataChanges()
+                  }
+                }
+              }
+              if (canSaveBill) {
+                if (typeof haveChangeBill == 'boolean') {
+                  issubmit = !haveChangeBill
+                } else {
+                  issubmit = false
                 }
-            });
-            return billInsightOption
-        },
-        updateBillInsightNum: function (billInsightOption) {
-            if (!billInsightOption.allExecSuccess) {
-                $("#li_riskInsight span").eq(0).text(_self._localeStr.WEB_RISKINSIGHT + "(" + billInsightOption.failSize + ")")
+              }
             } else {
-                $("#li_riskInsight span").eq(0).text(_self._localeStr.WEB_RISKINSIGHT)
+              issubmit = true
             }
-        },
-        openPerson: function (event, value) {
-            var selectedIds = waf("#textCC").prop("personIds");
-            var height = 552;
-            if (window.screen.height < 800) {
-                height = 500
-            }
-            var tempWin;
-            if (parent.waf) {
-                tempWin = parent.waf.window
-            } else {
-                tempWin = waf.window
-            }
-            tempWin.open({
-                url: waf.getContextPath() + "/webviews/workflow/commonSelectF7.jsp?f7Type=person&singleSelect=false&selectedIds=" + encodeURIComponent(selectedIds),
-                openType: "iframe",
-                method: "POST",
-                data: {},
-                style: {
-                    padding: "0px"
-                },
-                modal: true,
-                title: _self._localeStr.WEB_CC,
-                position: "center",
-                width: 1000,
-                height: height,
-                minHeight: height,
-                minWidth: 1000,
-                iconCls: "waf-ui-icon",
-                draggable: true,
-                resizable: true,
-                close: function (event, ui) { },
-                retValCallBack: function (resultData) {
-                    if (resultData && resultData.resultStr && resultData.resultStr.length > 0) {
-                        var val = resultData.resultStr.split("||");
-                        waf("#textCC").prop("personIds", val[1]);
-                        waf("#textCC").val(val[2])
-                    }
-                }
-            })
-        },
-        _pageLoadCompletedEventHandler: function () { },
-        openAttachmentPage: function (event, value) {
-            var url = "/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.AttachmentList&assignId=" + assign.assignId + "&billId=" + encodeURIComponent(assign.billId);
-            var pageType = _self.getUrlParam("type");
-            if (pageType != null && "passComent" === pageType) {
-                url += "&isPassAround=true"
+          }
+        } else {
+          issubmit = true
+        }
+      } else {
+        issubmit = true
+      }
+      return issubmit
+    },
+    _save: function (isReadOnly) {
+      assign.operation = 'approve'
+      var approve = _private.getApprove()
+      if (!approve) {
+        return
+      }
+      if (
+        isReadOnly === undefined ||
+        isReadOnly === null ||
+        isReadOnly === ''
+      ) {
+        isReadOnly = true
+      }
+      if (!isReadOnly) {
+        var frame = document.getElementById('billFrame')
+        if (
+          frame.contentDocument.getElementById('frame_tab_0') != null &&
+          frame.contentDocument.getElementById('frame_tab_0') != undefined
+        ) {
+          frame = frame.contentDocument.getElementById('frame_tab_0')
+        }
+        if (frame.contentWindow._self.getCurrentModel) {
+          var modelInfo = frame.contentWindow._self.getCurrentModel()
+          var editModel = JSON.stringify(modelInfo)
+          approve.model = editModel
+        }
+        if (approve.model == null) {
+          if (frame.contentWindow._self.fireEvent) {
+            var s = frame.contentWindow._self.fireEvent('save')
+            if (!s) {
+              return false
             }
-            waf.window.open({
-                url: url,
-                openType: "iframe",
-                modal: true,
-                title: _self._localeStr.WEB_ATCHMNTMANAGE,
-                position: "center",
-                width: 900,
-                height: 600,
-                iconCls: "waf-ui-icon",
-                draggable: true,
-                resizable: true,
-                close: function (event, ui) {
-                    waf.window.close();
-                    _private.refreshAttachCount()
+          }
+        }
+      }
+      approve.isReadOnly = isReadOnly.toString()
+      if ($('#textCC').prop('personIds')) {
+        approve.ccPersonIds = $('#textCC').prop('personIds')
+        approve.personName = $('#textCC').prop('value')
+      }
+      var params = {}
+      params.approve = JSON.stringify(approve)
+      waf.doPost({
+        url: waf.getContextPath() + '/common/tree.do?method=saves',
+        data: params,
+        success: function (data) {
+          if (data) {
+            assign.id = data
+            _self.showSuccess(_self._localeStr.WEB_SAVESUCCESS)
+          }
+        }
+      })
+    },
+    backto: function () {
+      try {
+        if (
+          $('#billFrame').length > 0 &&
+          $('#billFrame')[0].contentWindow._self.fireEvent
+        ) {
+          $('#billFrame')[0].contentWindow._self.fireEvent('destroyEvent')
+        }
+      } catch (e) {
+        console.log('流程中心手动释放单据锁失败')
+      }
+      if (waf.isInFramePage()) {
+        waf.closeCurPageTab()
+      } else {
+        if (
+          top &&
+          top.jMessager &&
+          top.jMsgcenter &&
+          top.jMsgcenter.tab_post_add
+        ) {
+          setTimeout(function () {
+            top.jMessager.sendMsg(top.jMsgcenter.tab_close)
+          }, 800)
+        } else {
+          setTimeout(function () {
+            try {
+              if (window.opener) {
+                if (window.opener.refreshCurrentPage) {
+                  window.opener.refreshCurrentPage()
                 }
-            })
-        },
-        refreshAttachCount: function () {
-            waf.doPost({
-                url: waf.getContextPath() + "/iwebattachment.do?method=getAttachCountByBill",
-                data: {
-                    billId: assign.billId
-                },
-                async: false,
-                success: function (data) {
-                    _private.refreshAttachCountInner(data)
+                if (opener.waf && opener.waf('#queryGrid')[0] != undefined) {
+                  opener.waf('#queryGrid').wafGrid('reloadGrid')
                 }
-            })
-        },
-        refreshAttachCountInner: function (count) {
-            var attachmentBtnTitle = _self._localeStr.WEB_ATCHMNTMANAGE;
-            if (count > 0) {
-                attachmentBtnTitle = _self._localeStr.WEB_ATCHMNTMANAGE + "(" + count + ")"
+              }
+            } catch (e) {}
+            try {
+                // 尝试关闭窗口
+                window.close();
+                // 检查窗口是否仍然存在,如果存在则表示没有权限
+                if (!window.closed) {
+                    console.log("没有权限关闭窗口。");
+                    location.href = "/shr/dynamic.do?uipk=shr.workflow.view&inFrame=true&target=allMessageConfig";
+                }
+            } catch (error) {
+                console.log("关闭窗口失败:", error.message);
+                _self.showSuccess(_self._localeStr.WEB_TASKHASDONE)
+            }
+          }, 500)
+        }
+      }
+    },
+    addUploadHtml: function () {
+      var attachmentUploadUrl =
+        waf.getContextPath() +
+        '/iwebattachment.do?method=upload&bosID=' +
+        encodeURIComponent(assign.billId) +
+        '&beizhu=' +
+        assign.assignId
+      var options = {
+        autoUpload: true,
+        url: attachmentUploadUrl,
+        multiSelect: true,
+        onComplete: function (e, data) {
+          _private.getAttchmentcount()
+        },
+        onAdd: function (e, data) {},
+        onFail: function (e, data) {
+          if (data.result.length > 0) {
+            if (data.result[0].error) {
+              _self.showInfo(data.result[0].error)
+            }
+          }
+        }
+      }
+      $('#upload').wafFileUploadUI(options)
+      _private.getAttchmentcount()
+    },
+    getAttchmentcount: function () {
+      var params = {}
+      params.assignId = assign.assignId
+      params.billId = assign.billId
+      var pageType = _self.getUrlParam('type')
+      if (pageType != null && 'passComent' === pageType) {
+        params.isPassAround = true
+      }
+      waf.doPost({
+        url: waf.getContextPath() + '/iwebattachment.do?method=getDataList',
+        data: params,
+        success: function (data) {
+          if (data.disabled) {
+            $('#attchment,.attchmentnuminfo,#upload').remove()
+            return
+          }
+          if (!data.canAdd) {
+            $('#upload').remove()
+          }
+          var len = data.list.length
+          $('#attchmentnum').html(len)
+          if (len > 0) {
+            waf('#attchment').wafSection('open')
+          } else {
+            waf('#attchment').wafSection('close')
+          }
+          var _html = ''
+          for (var i = 0; i < len; i++) {
+            var row = data.list[i]
+            var simpleName = row.simpleName
+            var classname = 'file'
+            var picFormat = ['jpg', 'gif', 'jpeg', 'png', 'bmp']
+            if (picFormat.indexOf(simpleName) > -1) {
+              classname = 'pic'
+            }
+            _html +=
+              '<li><div><i class="' +
+              classname +
+              '"></i><span class="name" title="' +
+              row.name +
+              '.' +
+              simpleName +
+              '">' +
+              row.name +
+              '.' +
+              simpleName +
+              '</span><span class="size">(' +
+              row.size +
+              ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' +
+              row.id +
+              '" download="' +
+              row.name +
+              '.' +
+              simpleName +
+              '" target="_blank"></a>'
+            if (classname == 'pic') {
+              _html +=
+                '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
+                row.id +
+                "','pic')\"></i>"
+            } else {
+              if (simpleName == 'pdf') {
+                _html +=
+                  '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
+                  row.id +
+                  "','pdf')\"></i>"
+              }
+            }
+            if (row.canDelete) {
+              _html +=
+                '<i class="delete" onclick="javascript:_self.attachmentDelete(\'' +
+                row['boAttchAsso.id'] +
+                "','" +
+                row.id +
+                '\')"></i>'
+            }
+            _html += '</div></li>'
+          }
+          $('#attachmentContent ul')[0].innerHTML = _html
+        }
+      })
+    },
+    attachmentDelete: function (bosId, attachId) {
+      var ok = function () {
+        waf.doPost({
+          url: waf.getContextPath() + '/iwebattachment.do?method=delete',
+          data: { bosId: bosId, attachId: attachId },
+          success: function (data) {
+            _self.showSuccess(_self._localeStr.WEB_ATTACHMENTDELETESUCESS)
+            _self.getAttchmentcount()
+          }
+        })
+      }
+      var cancel = function () {
+        return
+      }
+      waf.msgBox.showConfirm({
+        title: _self._localeStr.WEB_MESSPROMPT,
+        summaryMsg: _self._localeStr.WEB_DeleteFile,
+        buttonType: 'ok-cancel',
+        buttonCallBack: [ok, cancel]
+      })
+    },
+    attachmentView: function (id, type) {
+      var url = ''
+      if (type == 'pic') {
+        url = '/easweb/webviews/workflow/viewpic.jsp?bosID=' + id
+      } else {
+        if (type == 'pdf') {
+          url =
+            '/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=' +
+            id
+        }
+      }
+      window.open(url, '_blank')
+    },
+    billImage: function (event, value) {
+      var params = {}
+      params.billID = assign.billId
+      params.method = 'getimageurl'
+      waf.doPost({
+        url: waf.getContextPath() + '/workflow/approve.do',
+        data: params,
+        success: function (data) {
+          var url = data.imgurl
+          if (url == '') {
+            _self.showWarning(
+              _self._localeStr.WEB_IMAGESTATE +
+                data.state +
+                _self._localeStr.WEB_SUPPORTSTATE
+            )
+          } else {
+            if (url == 'noImg') {
+              _self.showWarning(_self._localeStr.WEB_HASNOIMAGE)
+            } else {
+              window.open(url, '_blank')
             }
-            $("#attachmentBtn span").text(attachmentBtnTitle)
-        },
-        getAssignInfo: function () {
-            return assign
+          }
+        }
+      })
+    },
+    bill: function (event, value) {
+      var para = {}
+      if (approvetype == 'batchapprove') {
+        var assignIds = _private.getbatchid().assignIds
+        if (assignIds.split(';').length != 1) {
+          _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
+          return false
+        }
+        para.sourceID = assignIds
+      } else {
+        para.sourceID = assign.assignId
+      }
+      para.msgId = msgId
+      wfCommonUtil.showBill(para)
+    },
+    messageDigest: function () {
+      var messageDigest = assign.messageDigest
+      if (messageDigest.toString().indexOf('table') > 0) {
+        waf('#panel5').wafPanel('option', 'hidden', true)
+        waf('#bill').wafSection('option', 'hidden', false)
+        document.getElementById('bill_content').innerHTML = messageDigest
+      } else {
+        waf('#billFrame').remove()
+        waf('#billAttachment').remove()
+        var billDigest = eval('(' + messageDigest + ')')
+        var options = {
+          title: _self._localeStr.WEB_BASICINFO,
+          id: 'billBaseInfo',
+          name: 'billBaseInfo',
+          openIconCls: 'ui-section-minus',
+          closeIconCls: 'ui-section-plus',
+          autoOpen: true,
+          style: 'margin-right: 0px;'
+        }
+        var billBaseInfo = waf.createDOM('section', options)
+        waf.appendDOM(waf('#panel5'), billBaseInfo)
+        waf.initComponent('section', options, billBaseInfo)
+        var items = billDigest.items
+        for (var i = 0; i < items.length; i++) {
+          var labeloptions = {
+            id: 'labelContainer' + i,
+            caption: items[i][0],
+            style: 'width: 33%;float: left;'
+          }
+          var labeldom = waf.createDOM('labelContainer', labeloptions)
+          waf('#billBaseInfo').wafSection('appendChildren', labeldom)
+          waf.initComponent('labelContainer', labeloptions, labeldom)
+          var txtoptions = { id: 'billbase' + i, caption: items[i][1] }
+          var textDom = waf.createDOM('label', txtoptions)
+          labeldom.wafLabelContainer('append', textDom)
+          waf.initComponent('label', txtoptions, textDom)
+        }
+        var entries = billDigest.entrys
+        for (var j = 0; j < entries.length; j++) {
+          var obj = entries[j]
+          var billEntriesoptions = {
+            title: obj.alias.l2,
+            id: 'billEntriesInfo' + j,
+            name: 'billEntriesInfo' + j,
+            openIconCls: 'ui-section-minus',
+            closeIconCls: 'ui-section-plus',
+            autoOpen: true,
+            style: 'margin-right: 0px;'
+          }
+          var billEntriesInfo = waf.createDOM('section', billEntriesoptions)
+          waf.appendDOM(waf('#panel5'), billEntriesInfo)
+          waf.initComponent('section', billEntriesoptions, billEntriesInfo)
+          if (obj.values.length > 0) {
+            var colmodel = []
+            var env = obj.values[0].items
+            for (var m = 0; m < env.length; m++) {
+              var para = { name: env[m][3], label: env[m][0] }
+              colmodel.push(para)
+            }
+            var myGridoptions = { id: 'myGrid' + j, colModel: colmodel }
+            var dom = waf.createDOM('grid', myGridoptions)
+            waf('#billEntriesInfo' + j).wafSection('appendChildren', dom)
+            waf.initComponent('grid', myGridoptions, dom)
+            var rowData = obj.values
+            var gridData = new Array()
+            for (var n = 0; n < rowData.length; n++) {
+              var rr = rowData[n].items
+              var rowdata = {}
+              for (var h = 0; h < rr.length; h++) {
+                var colname = rr[h][3]
+                rowdata[colname] = rr[h][1]
+              }
+              gridData.push(rowdata)
+            }
+            waf('#myGrid' + j).wafGrid('addRow', { data: gridData })
+          }
+        }
+      }
+    },
+    initMsgDigestBillAttach: function () {
+      var billAttachmentList = assign.billAttachments
+      var billAttachmentOptions = {
+        title: _self._localeStr.WEB_ATTACHMENT,
+        id: 'billAttachment',
+        name: 'billAttachment',
+        openIconCls: 'ui-section-minus',
+        closeIconCls: 'ui-section-plus',
+        autoOpen: true,
+        style: 'margin-right: 0px;'
+      }
+      var billAttachment = waf.createDOM('section', billAttachmentOptions)
+      waf.appendDOM(waf('#panel5'), billAttachment)
+      waf.initComponent('section', billAttachmentOptions, billAttachment)
+      $('#billAttachment .title').after(
+        '<span id="billAttachTitle">' +
+          _self._localeStr.WEB_TOTALATCHMNT +
+          '<i></i><span>' +
+          billAttachmentList.length +
+          '</span>个</span>'
+      )
+      var _html = "<div class='attachmentContent'><ul>"
+      for (var i = 0; i < billAttachmentList.length; i++) {
+        var row = billAttachmentList[i]
+        var simpleName = row.simpleName
+        var classname = 'file'
+        var picFormat = ['jpg', 'gif', 'jpeg', 'png', 'bmp']
+        if (picFormat.indexOf(simpleName) > -1) {
+          classname = 'pic'
+        }
+        var judgeAttachType = ''
+        if (row.attachTypeEnum == 1) {
+          judgeAttachType =
+            "<span class='procAttach'>" +
+            _self._localeStr.WEB_PROCESSATTACHMENTS +
+            '</span>'
+        }
+        _html +=
+          '<li><div><i class="' +
+          classname +
+          '"></i><span class="name" title="' +
+          row.name +
+          '.' +
+          simpleName +
+          '">' +
+          judgeAttachType +
+          row.name +
+          '.' +
+          simpleName +
+          '</span><span class="size">(' +
+          row.size +
+          ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' +
+          row.id +
+          '" download="' +
+          row.name +
+          '.' +
+          simpleName +
+          '" target="_blank"></a>'
+        if (classname == 'pic') {
+          _html +=
+            '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
+            row.id +
+            "','pic')\"></i>"
+        } else {
+          if (simpleName == 'pdf') {
+            _html +=
+              '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
+              row.id +
+              "','pdf')\"></i>"
+          }
+        }
+        _html += '</div></li>'
+      }
+      _html += '</ul></div>'
+      return _html
+    },
+    selattachment: function (item, attcreater, beizhu) {},
+    showoperate: function (event, value) {
+      var para = {}
+      if (approvetype == 'batchapprove') {
+        var assignIds = _private.getbatchid().assignIds
+        if (assignIds.split(';').length != 1) {
+          _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
+          return false
+        }
+        para.assignmentId = assignIds.split(';')[0]
+      } else {
+        para.assignmentId = assign.assignId
+      }
+      if (wfCommonUtil.getOperationRecordsPerm(para.assignmentId)) {
+        wfCommonUtil.showApproveDetail(para)
+      } else {
+        waf.msgBox.showInfo({
+          title: _self._localeStr.WEB_MESSAGEALERT,
+          summaryMsg: _self._localeStr.WEB_FORBIDVIEW
+        })
+        $('.ui-msgbox .content').width('330px')
+      }
+    },
+    esignatureOnClick: function (event, ui) {
+      if (ui.checked) {
+        $('#esigndiv').show()
+      } else {
+        $('#esigndiv').hide()
+      }
+    },
+    isWaf1Bill: function (url) {},
+    jMessageAlert: function (message) {
+      _self.showInfo(message)
+    },
+    onselect: function (event, ui) {
+      if (riskInsight) {
+        if (ui.panel.id == 'riskInsight') {
+          waf('#billInsight').billInsight(
+            'intelligentInspection',
+            billInsightOption.list
+          )
+          waf('body').unbind('click')
+          $('.billInsight_cardPanel').draggable('disable')
+          _private.updateBillInsightNum(billInsightOption)
+          _private.resizeBillInsight(false)
+          _private.curTab = 'riskInsight'
+        } else {
+          $('.billInsight_cardPanel').css('display', 'none')
+          _private.curTab = ''
+        }
+      }
+    },
+    resizeBillInsight: function (windowResize) {
+      var top = $('#li_approveTask').offset().top + 44
+      var left = $('#li_approveTask').offset().left
+      if (!windowResize) {
+        left += 10
+      }
+      var width = $('#tabs_ul').width()
+      var t =
+        $('.ui-cardPanel').attr('style') + 'width:' + width + 'px !important'
+      $('.billInsight_cardPanel').css('cssText', t)
+      $('.billInsight_cardPanel').css({ top: top, left: left })
+      $(
+        '.ui-cardPanel .noRecords,.ui-cardPanel .noRecordsImage,.ui-cardPanel .noRecordsText'
+      ).css({ width: '100%', margin: '0px', 'min-width': '160px' })
+    },
+    getWeakRisk: function () {
+      var urlParams = waf.getUrlParam(assign.billEditUrl)
+      var billId = urlParams.billId
+      var uipk = urlParams.uipk
+      var billInsightOption = {}
+      waf.doPost({
+        async: false,
+        url:
+          waf.getContextPath() + '/risk/ForWebController.do?method=getWeakRisk',
+        data: { uipk: uipk, id: billId, riskIds: assign.riskInsight },
+        success: function (data) {
+          if (data != null) {
+            billInsightOption = data
+          }
+        }
+      })
+      return billInsightOption
+    },
+    updateBillInsightNum: function (billInsightOption) {
+      if (!billInsightOption.allExecSuccess) {
+        $('#li_riskInsight span')
+          .eq(0)
+          .text(
+            _self._localeStr.WEB_RISKINSIGHT +
+              '(' +
+              billInsightOption.failSize +
+              ')'
+          )
+      } else {
+        $('#li_riskInsight span').eq(0).text(_self._localeStr.WEB_RISKINSIGHT)
+      }
+    },
+    openPerson: function (event, value) {
+      var selectedIds = waf('#textCC').prop('personIds')
+      var height = 552
+      if (window.screen.height < 800) {
+        height = 500
+      }
+      var tempWin
+      if (parent.waf) {
+        tempWin = parent.waf.window
+      } else {
+        tempWin = waf.window
+      }
+      var params = {}
+      params.f7Type = encodeURIComponent('person')
+      params.singleSelect = false
+      tempWin.open({
+        url:
+          waf.getContextPath() +
+          '/webviews/workflow/commonSelectF7.jsp?selectedIds=' +
+          encodeURIComponent(selectedIds),
+        openType: 'iframe',
+        method: 'POST',
+        data: params,
+        style: { padding: '0px' },
+        modal: true,
+        title: _self._localeStr.WEB_CC,
+        position: 'center',
+        width: 1000,
+        height: height,
+        minHeight: height,
+        minWidth: 1000,
+        iconCls: 'waf-ui-icon',
+        draggable: true,
+        resizable: true,
+        close: function (event, ui) {},
+        retValCallBack: function (resultData) {
+          if (
+            resultData &&
+            resultData.resultStr &&
+            resultData.resultStr.length > 0
+          ) {
+            var val = resultData.resultStr.split('||')
+            waf('#textCC').prop('personIds', val[1])
+            waf('#textCC').val(val[2])
+          }
+        }
+      })
+    },
+    _pageLoadCompletedEventHandler: function () {},
+    openAttachmentPage: function (event, value) {
+      var url =
+        '/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.AttachmentList&assignId=' +
+        assign.assignId +
+        '&billId=' +
+        encodeURIComponent(assign.billId)
+      var pageType = _self.getUrlParam('type')
+      if (pageType != null && 'passComent' === pageType) {
+        url += '&isPassAround=true'
+      }
+      waf.window.open({
+        url: url,
+        openType: 'iframe',
+        modal: true,
+        title: _self._localeStr.WEB_ATCHMNTMANAGE,
+        position: 'center',
+        width: 900,
+        height: 600,
+        iconCls: 'waf-ui-icon',
+        draggable: true,
+        resizable: true,
+        close: function (event, ui) {
+          waf.window.close()
+          _private.refreshAttachCount()
+        }
+      })
+    },
+    refreshAttachCount: function () {
+      waf.doPost({
+        url:
+          waf.getContextPath() +
+          '/iwebattachment.do?method=getAttachCountByBill',
+        data: { billId: assign.billId },
+        async: false,
+        success: function (data) {
+          _private.refreshAttachCountInner(data)
         }
-    });
-    _self.subscribeEvent("pageLoadCompletedEvent", _private._pageLoadCompletedEventHandler, "after");
-    return _public
-});
+      })
+    },
+    refreshAttachCountInner: function (count) {
+      var attachmentBtnTitle = _self._localeStr.WEB_ATCHMNTMANAGE
+      if (count > 0) {
+        attachmentBtnTitle =
+          _self._localeStr.WEB_ATCHMNTMANAGE + '(' + count + ')'
+      }
+      $('#attachmentBtn span').text(attachmentBtnTitle)
+    },
+    getAssignInfo: function () {
+      return assign
+    }
+  })
+  _self.subscribeEvent(
+    'pageLoadCompletedEvent',
+    _private._pageLoadCompletedEventHandler,
+    'after'
+  )
+  return _public
+})

+ 95 - 0
properties/XTServiceConfig.xml

@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+	<configitem name="ReadMode">
+		<!-- 读取重载,每当读取配置项时是否重新加载配置文件以获取最新的设置。 true:重新加载; false:不重新加载 -->
+		<attribute key="reload" value="false" />
+	</configitem>
+	<!--讯通相关信息-->
+	<configitem name="XTInfo">
+		<!--讯通公共号正文头格式-->
+		<attribute key="xt.pubacct.connect.content.type" value="application/x-www-form-urlencoded" />
+		<!--讯通公共号通讯地址-->
+		<attribute key="newxt.pubacct.connect.server.url" value="http://kingdee.yunzhijia.com/gateway/newtodo/open" />
+		<!--待办消息推送接口-->
+		<attribute key="xt.pubacct.connect.server.url" value="http://kingdee.yunzhijia.com/pubacc/pubsend" />
+		<attribute key="xt.mcloud.url" value="http://kingdee.yunzhijia.com" />
+	</configitem>
+	
+	<configitem name="OtherApp">
+		<attribute key="tokenurl" value="http://ehr.shichuangyi.cn:8080/shr/api/oAToMBos" />
+		<attribute key="appid" value="10036" />
+		<attribute key="secret" value="gydasgdasdotwe156456daswer" />
+	</configitem>
+	<!--应用的AppSecret-->
+	<configitem name="AppSecret">
+		<!--轻应用1-->
+		<attribute key="10101" value="123456789" />
+		<attribute key="10036" value="123456789" />
+		<attribute key="50203" value="123456789" />
+		<attribute key="1008" value="1008" />
+		<attribute key="10016" value="10016" />
+		<attribute key="10072" value="10072" />
+		<attribute key="10017" value="10017" />
+		<attribute key="10074" value="10074" />
+		<attribute key="10073" value="10073" />
+		<attribute key="10060" value="123456789" />
+		<attribute key="dingio9b8oe6g5xkbfyn" value="28xkWOB_snAknvn5yzQHuMKSdsSz47QyBYx96iQoX4Uoh-n7uiFcnKIWFrdxImuP" />
+		<attribute key="ding4ebdbr8hrfuzlqbw" value="S6AZpfGBD1JpTsp0Yy5y9N0jfUiuE4tTXkyLKgGw6lSEpyMfuLqcfS0bYvpPodOt" />
+	</configitem>
+	<!--数据库信息-->
+	<configitem name="DbInfo">
+		<configitem name="dingb5e04fd74685987d35c2f4657eb6378f">
+			<!--EAS数据中心代码(是代码,不是名称!)-->
+			<attribute key="dbCode" value="scy01" />
+			<!--数据库类型,0:SQLServer,1:DB2,2:Oracle-->
+			<attribute key="dbType" value="3" />
+			<!--解决方案名(一般为eas,无需修改)-->
+			<attribute key="slnName" value="eas" />
+			<!--语言,L2为简体中文-->
+			<attribute key="locale" value="L2" />
+		</configitem>
+		<!-- OA集成Mbos -->
+		<configitem name="K172K145K108K99K127">
+			<!--EAS数据中心代码(是代码,不是名称!)-->
+			<attribute key="dbCode" value="scy01" />
+			<!--数据库类型,0:SQLServer,1:DB2,2:Oracle-->
+			<attribute key="dbType" value="3" />
+			<!--解决方案名(一般为eas,无需修改)-->
+			<attribute key="slnName" value="eas" />
+			<!--语言,L2为简体中文-->
+			<attribute key="locale" value="L2" />
+		</configitem>
+	</configitem>
+	<!-- 讯通公共号信息 -->
+	<configitem name="PubAcct">
+		<configitem name="dingb5e04fd74685987d35c2f4657eb6378f">
+			<!-- 新闻公告公共号 -->
+			<configitem name="WFMessage">
+				<!-- 公共号代码 -->
+				<attribute key="code" value="XT-6fb96101-b0d7-445e-b53b-cd8b4373d6d7" />
+				<attribute key="pubKey" value="c3b5fc1703dadfb5b815092bac5951a0" />
+				<attribute key="host" value="https://mbos.kdeascloud.com/mbos/page/loadPage?path=lczs2" />
+				<attribute key="appId" value="dingio9b8oe6g5xkbfyn" />
+				<attribute key="eid" value="dingb5e04fd74685987d35c2f4657eb6378f" />
+				<attribute key="signKey" value="oVtDSHrx4SgL6mu8" />
+				<!--  快捷审批 -->
+				<attribute key="MsgShow" value="1" />
+				<!-- 启用状态 -->
+				<attribute key="enabled" value="true" />
+				<!-- 讯通公共号企业服务器本地目录,用于处理发送时的临时文件,环境变量用${...}表示 -->
+				<attribute key="xt.pubacct.local.server.dir" value="${EAS_HOME}/server/deploy/eas.ear/workflow.war/xt" />
+				<!-- 推送后清理临时文件 -->
+				<attribute key="clean" value="false" />
+			</configitem>
+		</configitem>
+	</configitem>
+	<configitem name="Dingtalk">
+		<attribute key="CorpId" value="dingb5e04fd74685987d35c2f4657eb6378f" />
+		<attribute key="ApiType" value="3" />
+		<configitem name="dingb5e04fd74685987d35c2f4657eb6378f">
+			<attribute key="AgentId" value="3288052852" />
+			<attribute key="AppKey" value="dingio9b8oe6g5xkbfyn" />
+			<attribute key="AppSecret" value="28xkWOB_snAknvn5yzQHuMKSdsSz47QyBYx96iQoX4Uoh-n7uiFcnKIWFrdxImuP" />
+		</configitem>
+	</configitem>
+</config>

+ 2 - 2
properties/scy/OAToMBosConfig.properties

@@ -1,10 +1,10 @@
 #OA认证
 authorizePath=http://oa.shichuangyi.cn:8080/sso/oauth2.0/authorize
-client_id=4385e7ea-16cc-4328-a9dc-a3046c5b1614
+client_id=7ca080c2-4793-4b2c-ac07-439ccad67c14
 response_type=code
 redirect_uri1=http://ehr.shichuangyi.cn:8080/shr/api/oAToMBos
 getAccessTokenPath=http://oa.shichuangyi.cn:8080/sso/oauth2.0/accessToken
-client_secret=OtuYO2Uwxp9mjrOcbiWcTWMA
+client_secret=Vh5s6Hc4JzJm9LJevbX9Yy6L
 redirect_uri2=http://ehr.shichuangyi.cn:8080/shr/api/oAToMBos
 getLoginIdPath=http://oa.shichuangyi.cn:8080/sso/oauth2.0/profile
 serverName=http://ehr.shichuangyi.cn:8080