{"id":219,"date":"2019-05-07T17:30:35","date_gmt":"2019-05-07T09:30:35","guid":{"rendered":"http:\/\/www.hefeiyu.com\/?p=219"},"modified":"2019-05-07T18:25:29","modified_gmt":"2019-05-07T10:25:29","slug":"ecology8%e6%b5%81%e7%a8%8b%e8%a1%a8%e5%8d%95%e5%b8%b8%e7%94%a8js","status":"publish","type":"post","link":"https:\/\/www.hefeiyu.com\/?p=219","title":{"rendered":"ecology8\u6d41\u7a0b\u8868\u5355\u5e38\u7528js"},"content":{"rendered":"<article class=\"baidu_pl\">\n<div id=\"article_content\" class=\"article_content clearfix csdn-tracking-statistics\" data-pid=\"blog\" data-mod=\"popu_307\" data-dsm=\"post\">\n<div id=\"content_views\" class=\"htmledit_views\">\n<div style=\"line-height: 1.875;\"><span style=\"color: #ff0000;\"><strong><span style=\"font-size: 14px;\">1\u3001\u63d0\u4ea4\u9a8c\u8bc1\u8868\u5355\u7ed3\u675f\u65e5\u671f\u4e0d\u80fd\u5c11\u4e8e\u5f00\u59cb\u65e5\u671f<\/span><\/strong><\/span><\/div>\n<div style=\"line-height: 1.875;\">\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!\u2013 script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 \u2013&gt;\r\n\r\n&lt;script type=\u201dtext\/javascript\u201d&gt;\r\n    jQuery(document).ready(function () {\r\n        checkCustomize = function () { \/\/\u63d0\u4ea4\u9a8c\u8bc1\r\n            var returnval = true;\r\n            var beginDateTime = jQuery(\u201c#field5973\u201d).val();\r\n            var endDateTime = jQuery(\u201c#field5974\u201d).val();\r\n            if (beginDateTime.valueOf() &gt; endDateTime.valueOf()) {\r\n                Dialog.alert(\u201c\u5f00\u59cb\u65e5\u671f\u4e0d\u80fd\u5927\u4e8e\u7ed3\u675f\u65e5\u671f\u201d);\r\n                jQuery(\u201c#field5973\u201d).val(\u201c\u201d);\r\n                jQuery(\u201c#field5974\u201d).val(\u201c\u201d);\r\n                jQuery(\u201c#field5973span\u201d).html(\u201c\u201d);\r\n                jQuery(\u201c#field5974span\u201d).html(\u201c\u201d);\r\n                returnval = false;\r\n            }\r\n            return returnval;\r\n        }\r\n    });\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<div style=\"line-height: 1.875;\">\n<div style=\"line-height: 1.875;\"><span style=\"color: #ff0000;\"><strong><span style=\"font-size: 14px;\">2\u3001checkbox\u88ab\u9009\u4e2d\u76d1\u542c\u4e8b\u4ef6\uff0c\u76d1\u542ccheckbox\u590d\u9009\u6846 \u6253\u5f00\u8868\u5355\u9996\u5148\u9690\u85cf\u884c \u5982\u679ccheckbox\u88ab\u9009\u4e2d \u663e\u793a\u884c<\/span><\/strong><\/span><\/div>\n<div style=\"line-height: 1.875;\">\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!\u2013 script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 \u2013&gt;\r\n\r\n&lt;script type=\u201dtext\/javascript\u201d&gt;\r\n    jQuery(document).ready(function () {\r\n        jQuery(\u201c.mainTd_6_0\u201d).parent().hide();\r\n        jQuery(\u201c#field6421\u201d).click(function () {\r\n            if (jQuery(\u201c#field6421\u201d).attr(\u201cchecked\u201d) == true) {\r\n                jQuery(\u201c.mainTd_6_0\u201d).parent().show();\r\n            } else {\r\n                jQuery(\u201c.mainTd_6_0\u201d).parent().hide();\r\n            }\r\n        });\r\n    });\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<div style=\"font-size: 14px; line-height: 1.875;\"><\/div>\n<div style=\"line-height: 1.875;\"><strong><span style=\"font-size: 14px; color: #ff0000;\">3\u3001\u8868\u5355\u4e0e\u540e\u7aef\u8fdb\u884c\u6570\u636e\u4ea4\u4e92\u5e76\u56de\u5199<\/span><\/strong><\/div>\n<div style=\"line-height: 1.875;\">\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">jQuery(document).ready(function () {\r\n    var reuqestid = jQuery(\"input[name='requestid']\").val();\r\n    var xmlx = jQuery(\"#field7444\").val();\r\n    var szbm = jQuery(\"#field7445\").val();\r\n    var url = \"\/gfkd\/validatexmdm.jsp?type=4&amp;r=\" + Math.random();\r\n    var param = {\r\n        xmlx: xmlx,\r\n        szbm: szbm,\r\n        reuqestid: reuqestid\r\n    };\r\n    jQuery.getJSON(url, param, function (Json) {\r\n        if (Json.flg) {\r\n            jQuery(\"#field7330\").val(Json.msg);\r\n            jQuery(\"#field7330span\").text(Json.msg);\r\n        } else {\r\n            alert(Json.msg);\r\n        }\r\n    });\r\n});<\/code><\/pre>\n<\/div>\n<div style=\"line-height: 1.875;\">\n<p><span style=\"font-size: 14px; color: #ff0000;\"><strong>4\u3001\u8054\u7cfb\u7535\u8bdd\u5fc5\u987b\u8f93\u516511\u4f4d\u6570\u5b57\u9a8c\u8bc1\uff1a<\/strong><\/span><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!-- script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 --&gt;\r\n&lt; script type = \"text\/javascript\" &gt;\r\n    jQuery(document).ready(function () {\r\n        jQuery(\"#field6045\").bind(\"blur\", function () {\r\n            var a = jQuery(\"#field6045\").val();\r\n            if (!(\/^1(3|4|5|7|8)\\d{9}$\/.test(a))) {\r\n                alert(\"\u8054\u7cfb\u7535\u8bdd\u53ea\u80fd\u8f93\u516511\u4f4d\u6570\u5b57\uff01\u4f60\u8f93\u5165\u4fe1\u606f\u6709\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002\");\r\n                jQuery(\"#field6045\").attr(\"value\", \"\");\r\n            }\r\n        });\r\n    }); &lt; \/script&gt;<\/code><\/pre>\n<\/div>\n<p><strong><span style=\"font-size: 14px; color: #ff0000;\">5\u3001\u4ece\u9009\u53d6\u7684\u7684\u5b57\u6bb5\u81ea\u52a8\u586b\u5165\u5176\u4ed6\u5b57\u6bb5\uff1a<\/span><\/strong><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!-- script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 --&gt;\r\n&lt; script type = \"text\/javascript\" &gt;\r\n    jQuery(document).ready(function () {\r\n        jQuery(\"#requestname\").focus(function () {\r\n            var a = jQuery(\"#field6339span\").children().children().text();\r\n            jQuery(\"#requestname\").val(a);\r\n        });\r\n    }); &lt; \/script&gt;<\/code><\/pre>\n<div style=\"line-height: 1.875;\">\n<p><strong><span style=\"font-size: 14px; color: #ff0000;\">6\u3001\u6d41\u7a0b\u8868\u5355\u5f39\u51fa\u4e00\u4e2adiv\u5c42\u6b21<\/span><\/strong><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;script type=\"text\/javascript\"&gt;\r\n    jQuery(document).ready(function () {\r\n        checkCustomize = function () {\r\n            var flag = top.Dialog.confirm(\"\u4f60\u786e\u5b9a\u6d41\u7a0b\u8f6c\u4efb\u52a1\uff1f\");\r\n            alert(flag);\r\n            if (flag == true) {\r\n                var wtms = jQuery(\"#field5913\").val();\r\n                var bt = jQuery(\"input[name='requestname']\").val();\r\n                openDialog(\"\u6d41\u7a0b\u8f6c\u4efb\u52a1\", \"lbx\/workflowTotask.jsp?wtms=\" + wtms + \"&amp;bt=\" + bt);\r\n            }\r\n            return false;\r\n        }\r\n    });\r\n\r\n    function openDialog(title, url) {\u3000\u3000\u3000\r\n        var dlg = new window.top.Dialog(); \/\/\u5b9a\u4e49Dialog\u5bf9\u8c61\r\n        dialog.currentWindow = window;\u3000\u3000\u3000\r\n        dlg.Model = true;\u3000\u3000\u3000\r\n        dlg.Width = 100;\u3000\u3000\u3000\r\n        dlg.Height = 100;\u3000\u3000\u3000\r\n        dlg.URL = url;\u3000\u3000\u3000\r\n        dlg.Title = title;\u3000\u3000\u3000\r\n        dlg.show();\u3000\r\n    }\r\n&lt;\/script&gt;<\/code><\/pre>\n<div style=\"line-height: 1.875;\">\n<div style=\"line-height: 1.875;\"><strong><span style=\"font-size: 14px; color: #ff0000;\">7\u3001\u590d\u9009\u6846\u5fc5\u987b\u9009\u62e9\u4e00\u4e2a\u65b9\u53ef\u63d0\u4ea4\uff1a\u4ee3\u7801\u5982\u4e0b<\/span><\/strong><\/div>\n<div style=\"line-height: 1.875;\">\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!-- script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 --&gt;\r\n&lt; script type = \"text\/javascript\" &gt;\r\n    jQuery(document).ready(function () {\r\n        checkCustomize = function () {\r\n            var num = 0;\r\n            var checkBox = jQuery('input[type=\"checkbox\"]');\r\n            checkBox.each(function () {\r\n                if (jQuery(this).attr(\"checked\")) {\r\n                    num++;\r\n                }\r\n            });\u00a0\r\n            if (num &gt; 0) {\r\n                return true;\r\n            } else {\r\n                alert(\"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u5370\u7ae0\u7c7b\u522b\uff0c\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\uff01\");\r\n                return false;\r\n            }\r\n            return false;\r\n        }\r\n    }); \r\n&lt; \/script&gt;<\/code><\/pre>\n<\/div>\n<div><span style=\"font-size: 14px; color: #ff0000;\"><strong>8\u3001\u8ba9\u6d41\u7a0b\u7684\u7b7e\u5b57\u610f\u89c1\u6846\u9ed8\u8ba4\u5c55\u5f00<\/strong><\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-weight: bold;\"><span style=\"color: #ff0000;\">\u5728ecology\/workflow\/request\/WorkflowSignInput.jsp\u6700\u4e0b\u65b9\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/span><\/span><\/div>\n<div style=\"font-size: 14px;\">&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/div>\n<div>jQuery(document).ready(function(){<\/div>\n<div>$(&#8220;#remarkShadowDivInnerDiv&#8221;).trigger(&#8220;click&#8221;);<\/div>\n<div>});<\/div>\n<div style=\"font-size: 14px;\">&lt;\/script&gt;<\/div>\n<div>\n<div><span style=\"font-size: 14px; color: #ff0000;\"><strong>9\u3001\u6d41\u7a0b\u8868\u5355\u91cc\u9762\u600e\u4e48\u901a\u8fc7js\u83b7\u53d6\u5f53\u524d\u767b\u5f55\u4eba\u5458\u7684id<\/strong><\/span><\/div>\n<div style=\"font-size: 14px;\">var userid =wf__info.f_bel_userid\uff1b<\/div>\n<div style=\"font-size: 14px;\">var userid=window.__userid;<\/div>\n<div style=\"font-size: 14px;\">eg\uff1a<\/div>\n<div style=\"font-size: 14px;\">jQuery(document).ready(function(){<\/div>\n<div style=\"font-size: 14px;\">if(window.console) console.log (&#8220;wf__info.f_bel_userid=======&gt;&#8221;+wf__info.f_bel_userid);<\/div>\n<div style=\"font-size: 14px;\">if(window.console) console.log (&#8220;window.__userid=======&gt;&#8221;+window.__userid);<\/div>\n<div style=\"font-size: 14px;\">});<\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\"><strong><span style=\"font-size: 14px; color: #ff0000;\">10.\u5982\u4f55\u5b9e\u73b0\u767b\u5f55\u540d\u8bb0\u4f4f\u4e0a\u6b21\u767b\u5f55\u7684\u767b\u5f55\u540d<\/span><\/strong><\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">1.\u81ea\u884c\u4e0b\u8f7d\/jquery.cookie.js;\u653e\u5230\/wui\/common\/jquery\/plugin\/\u76ee\u5f55\u4e0b<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">2.<\/span><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">\u5c06\u4ee5\u4e0b\u4ee3\u7801\u653e\u5230<\/span><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">\/wui\/theme\/ecology8\/page\/login.jsp<\/span><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\"><strong><br \/>\n<\/strong><\/span><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">\u9875\u9762\u4e2d45\u884c<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">&lt;script type=&#8221;text\/javascript&#8221; src=&#8221;\/wui\/common\/jquery\/plugin\/jquery.cookie.js&#8221;&gt;&lt;\/script&gt;<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">$(document).ready(function(){<br \/>\n<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">if($.cookie(&#8220;loginid_cookie&#8221;)!=undefined){<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">jQuery(&#8220;#loginid&#8221;).val($.cookie(&#8220;loginid_cookie&#8221;));<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">}<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">$(&#8220;#login&#8221;).click(function(){<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">$.cookie(&#8220;loginid_cookie&#8221;,jQuery(&#8220;#loginid&#8221;).val(),{expires:7});<\/span><\/div>\n<div><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">});<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">});<\/span><\/div>\n<div style=\"font-size: 14px;\"><span style=\"font-family: '\u5fae\u8f6f\u96c5\u9ed1';\">&lt;\/script&gt;<\/span><\/div>\n<div>\n<div><span style=\"font-size: 14px; color: #ff0000;\"><strong>11\u3001\u5982\u4f55\u7ed9\u5355\u5143\u683c\u6dfb\u52a0\u94fe\u63a5\u3010\u4f8b\u5982\uff1a\u83b7\u53d6\u5feb\u9012\u5355\u53f7\u3011<\/strong><\/span><\/div>\n<div style=\"font-size: 14px;\">\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">&lt;!-- script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 --&gt;\r\n\/\/\u83b7\u53d6\u5feb\u9012\u5355\u53f7\u4f5c\u4e3a\u53c2\u6570\u8df3\u8f6c\u5230\u5feb\u9012100\u8fdb\u884c\u5feb\u901f\u67e5\u8be2\r\n&lt; script type = \"text\/javascript\" &gt;\r\n    jQuery(document).ready(function () {\r\n        var kddh = $(\"#field7672\").val(); \/\/\u83b7\u53d6\u5feb\u9012\u5355\u53f7\r\n        var hrefstr = \"https:\/\/www.kuaidi100.com\/chaxun?nu=\" + kddh;\r\n        $(\"#kddh\").wrap(\"&lt;a href='\" + hrefstr + \"' target='_blank'&gt;&lt;\/a&gt;\");\r\n    }); \r\n&lt; \/script&gt;<\/code><\/pre>\n<\/div>\n<div><span style=\"font-weight: bold;\"><span style=\"color: #ff0000;\">12\u3001\u5982\u4f55\u8ba9\u6d41\u7a0b\u8868\u5355\u4e0a\u7684\u65f6\u95f4\u53ea\u663e\u793a5,10,15&#8230;..55<\/span><\/span><\/div>\n<div>\n<pre class=\"pure-highlightjs\"><code class=\"javascript\">function initTimeChooseDiv() {\r\n    var html = [];\r\n    html.push(\"&lt;tr&gt;\");\r\n    for (var i = 0; i &lt; 60; i++) {\r\n        var hidden = i % 10 == 0 ? \"\" : \"display:none;\"\r\n        html.push(\r\n            '&lt;td width=\"30\" align=\"center\" onmouseover=\"style.backgroundColor=\\'#BEEBEE\\'\" onmouseout=\"style.backgroundColor=\\'#fff\\'\" style=\"font-size: 9pt; font-family: Verdana; cursor: pointer; background-color: rgb(255, 255,\r\n255);' +\r\n            hidden + '\" onclick=\"getTime(minute' + i + ')\"&gt;' + i + '&lt;input type=\"hidden\" id=\"minute' + i + '\" value=\"' + i + '\"&gt;&lt;\/td&gt;');\r\n    }\r\n    html.push(\"&lt;\/tr&gt;\");\r\n    jQuery(\"#meizzDateLayer2\").contents().find(\"#TimeLayer tbody\").html(html.join(\"\"));\r\n    jQuery(\"#meizzDateLayer2\").width(\"190\").height(\"76\");\r\n}<\/code><\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/www.hefeiyu.com\">\u8d6b\u975e\u57df<\/a> &raquo; <a href=\"https:\/\/www.hefeiyu.com\/?p=219\">ecology8\u6d41\u7a0b\u8868\u5355\u5e38\u7528js<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>1\u3001\u63d0\u4ea4\u9a8c\u8bc1\u8868\u5355\u7ed3\u675f\u65e5\u671f\u4e0d\u80fd\u5c11\u4e8e\u5f00\u59cb\u65e5\u671f &lt;!\u2013 script\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u5f15\u7528js\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4e0eHTML\u4e2d\u76f8\u540c\u7684\u65b9\u5f0f\u3002 \u2013&gt; &lt;script type=\u201dtext\/javascript\u201d&gt; jQuery(document). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[103,102,8],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-code","tag-ecology8","tag-js","tag-oa"],"_links":{"self":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":5,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}