<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript">

    function isIE()
    {
        var ua = navigator.userAgent;
        if (ua.indexOf("MSIE") < 0 && ua.indexOf("Trident") < 0) { // not IE
            return false;
        } else { // IE
            return true;
        }
    }

    function ConnData()
    {
        alert(ConnDataXml());
        // Packing XML Code
        var xmlDom;
        if (!isIE()) { // code for others
            var parser = new DOMParser();
            xmlDom = parser.parseFromString(ConnDataXml(), "text/xml");
        } else { // code for IE
            xmlDom = new ActiveXObject("Microsoft.XMLDOM");
            xmlDom.loadXML(ConnDataXml());
        }

        // XMLHttpRequest Open &  Send
        var xmlHttp;
        if (window.XMLHttpRequest)
        {// code for IE7, Firefox, Opera, etc.
            xmlHttp=new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {// code for IE6, IE5
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        try {
            xmlHttp.open("POST", "http://gpwfstg.hlcm.com/wp/approval/Forms/Facade.aspx", false);
        } catch (e) {
            // Exception Handling
            /* ### Write Code ### */
        }
        xmlHttp.send(xmlDom);

        // Get XHR Result
        var xmlResult = xmlHttp.responseXML;

        // Extract Result Code
        var resultCode = "";
        if (xmlResult.evaluate) {
            var nodes = xmlResult.evaluate("RESULT/RESULTCODE", xmlResult, null, XPathResult.ANY_TYPE, null);
            resultCode = nodes.iterateNext().textContent;
        } else {
            resultCode = xmlResult.selectSingleNode("RESULT/RESULTCODE").text;
        }

        // Extract Result URL
        var draftUrl = "";
        if (xmlResult.evaluate) {
            var nodes = xmlResult.evaluate("RESULT/DRAFTURL", xmlResult, null, XPathResult.ANY_TYPE, null);
            draftUrl = nodes.iterateNext().textContent;
        } else {
            draftUrl = xmlResult.selectSingleNode("RESULT/DRAFTURL").text;
        }

        if (resultCode != "00000") { // Error Handling
            /* ### Write Error Handling Code ### */
            if (resultCode.indexOf('Z') > -1) {

            } else if (resultCode.indexOf('A') > -1) {

            } else if (resultCode.indexOf('B') > -1) {

            } else if (resultCode.indexOf('F') > -1) {

            } else {

            }
        } else { //
            // Open Doodream Approval Popup
            window.open(draftUrl, "", "width=940, height=650, scrollbars=yes, toolbar=no, location=no, status=no, menubar=no");
        }

    }


    function ConnDataXml() // 联动spec上规定的裁决邀请XML 构成
    {
        return  "<?xml version=\"1.0\" encoding=\"utf-8\"?><CONNROOT><CONN><KEYCODE>CFL-F0378266-3246-43A3-A288-020619E5274D</KEYCODE><UNIQUEID>295</UNIQUEID><RETURNURL><URLPATH>http://10.40.58.51:8081/hlap/modules/doodream/doodream_response.svc</URLPATH><LOGINID></LOGINID><PASSWORD></PASSWORD><RETURNFIELDLIST>UNIQUEID,DOCID,APRDOCSTATE,APRDOCSTATEMESSAGE,APPROVER_USERID,PPROVER_USERNM,APPROVER_TITLE,APRTYPE,\n" +
            "             APPROVER_PROCESSDATE, AGENTAPPROVER_USERID,AGENTAPPROVER_USERNM,AGENTAPPROVER_TITLE </RETURNFIELDLIST></RETURNURL></CONN><DOC><DOCTITLE>季付/半年付工作申请禀议</DOCTITLE><BODYTEXT><![CDATA[<style type=\"text/css\">\n" +
            "table.formtable{\n" +
            "  font-family: verdana,arial,sans-serif;\n" +
            "  font-size:11px;\n" +
            "  color:#333333;\n" +
            "  border-width: 1px;\n" +
            "  border-color: #666666;\n" +
            "  border-collapse: collapse;\n" +
            "  margin:20px;\n" +
            "}\n" +
            "table.formtable td {\n" +
            "  border-width: 1px;\n" +
            "  padding: 8px;\n" +
            "  border-style: solid;\n" +
            "  border-color: #666666;\n" +
            "  background-color: #ffffff;\n" +
            "}  \n" +
            ".titleTD {\n" +
            "  width:100px;\n" +
            "  font-weight:bold;\n" +
            "}  \n" +
            ".valueTD {\n" +
            "   width:255px;\n" +
            "}  \n" +
            "  table.gridtable {\n" +
            "  font-family: verdana,arial,sans-serif;\n" +
            "  font-size:11px;\n" +
            "  color:#333333;\n" +
            "  border-width: 1px;\n" +
            "  border-color: #666666;\n" +
            "  border-style: solid;\n" +
            "  border-collapse: collapse;\n" +
            "  margin:20px;\n" +
            "}\n" +
            "table.gridtable th {\n" +
            "  border-width: 1px;\n" +
            "  padding: 8px;\n" +
            "  border-style: solid;\n" +
            "  border-color: #666666;\n" +
            "  background-color: #dedede;\n" +
            "}\n" +
            "table.gridtable td {\n" +
            "  border-width: 1px;\n" +
            "  padding: 8px;\n" +
            "  width:150px;\n" +
            "  border-style: solid;\n" +
            "  border-color: #666666;\n" +
            "  background-color: #ffffff;\n" +
            "}\n" +
            "</style>\n" +
            "<table class=\"formtable\">\n" +
            "  <tr>\n" +
            "    <td class=\"titleTD\">合同编号</td>\n" +
            "    <td class=\"valueTD\">CON1805150001-1</td>\n" +
            "    <td class=\"titleTD\">客户名称</td>\n" +
            "    <td class=\"valueTD\">张三测试有限公司</td>\n" +
            "    <td class=\"titleTD\">信审等级</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "  </tr>\n" +
            "  <tr>\n" +
            "    <td class=\"titleTD\">机型</td>\n" +
            "    <td class=\"valueTD\">DH150LC-7,DH150LC-7</td>\n" +
            "    <td class=\"titleTD\">机号</td>\n" +
            "    <td class=\"valueTD\">26776,24592</td>\n" +
            "    <td class=\"titleTD\">交机日期</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "  </tr>\n" +
            "  <tr>\n" +
            "    <td class=\"titleTD\">融资金额</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "    <td class=\"titleTD\">首付比例</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "    <td class=\"titleTD\">首付金额</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "  </tr>\n" +
            "  <tr>\n" +
            "    <td class=\"titleTD\">融资期限</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "    <td class=\"titleTD\">利率</td>\n" +
            "    <td class=\"valueTD\">14%</td>\n" +
            "    <td class=\"titleTD\">代理商手续费</td>\n" +
            "    <td class=\"valueTD\"></td>\n" +
            "  </tr>\n" +
            "  <tr>\n" +
            "    <td class=\"titleTD\">意见/建议/申请事项</td>\n" +
            "    <td colspan=\"5\" class=\"valueTD\">123</td>\n" +
            "  </tr>\n" +
            "</table>  \n" +
            "<table class=\"gridtable\">\n" +
            "<tr>\n" +
            "  <th>期数</th>\n" +
            "  <th>现金流项目</th>\n" +
            "  <th>支付日</th>\n" +
            "  <th>应收/付金额</th\n" +
            "  ><th>应收本金</th>\n" +
            "  <th>应收利息</th>\n" +
            "  <th>剩余本金</th>\n" +
            "</tr><tr>\n" +
            "  <td>0</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-02-15</td>\n" +
            "  <td></td>\n" +
            "  <td></td>\n" +
            "  <td></td>\n" +
            "  <td>4,037,500.00</td>\n" +
            "</tr><tr>\n" +
            "  <td>1</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-03-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>154,471.42</td>\n" +
            "  <td>49,583.33</td>\n" +
            "  <td>3,885,086.67</td>\n" +
            "</tr><tr>\n" +
            "  <td>2</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-04-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>156,273.59</td>\n" +
            "  <td>47,781.17</td>\n" +
            "  <td>3,730,723.90</td>\n" +
            "</tr><tr>\n" +
            "  <td>3</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-05-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>158,096.78</td>\n" +
            "  <td>45,957.97</td>\n" +
            "  <td>3,574,386.77</td>\n" +
            "</tr><tr>\n" +
            "  <td>4</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-06-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>159,941.24</td>\n" +
            "  <td>44,113.51</td>\n" +
            "  <td>3,416,050.02</td>\n" +
            "</tr><tr>\n" +
            "  <td>5</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-07-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>161,807.22</td>\n" +
            "  <td>42,247.53</td>\n" +
            "  <td>3,255,688.07</td>\n" +
            "</tr><tr>\n" +
            "  <td>6</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-08-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>163,694.97</td>\n" +
            "  <td>40,359.78</td>\n" +
            "  <td>3,093,275.02</td>\n" +
            "</tr><tr>\n" +
            "  <td>7</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-09-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>165,604.75</td>\n" +
            "  <td>38,450.01</td>\n" +
            "  <td>2,928,784.62</td>\n" +
            "</tr><tr>\n" +
            "  <td>8</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-10-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>167,536.80</td>\n" +
            "  <td>36,517.95</td>\n" +
            "  <td>2,762,190.33</td>\n" +
            "</tr><tr>\n" +
            "  <td>9</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-11-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>169,491.40</td>\n" +
            "  <td>34,563.35</td>\n" +
            "  <td>2,593,465.22</td>\n" +
            "</tr><tr>\n" +
            "  <td>10</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2018-12-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>171,468.80</td>\n" +
            "  <td>32,585.95</td>\n" +
            "  <td>2,422,582.04</td>\n" +
            "</tr><tr>\n" +
            "  <td>11</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-01-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>173,469.27</td>\n" +
            "  <td>30,585.49</td>\n" +
            "  <td>2,249,513.18</td>\n" +
            "</tr><tr>\n" +
            "  <td>12</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-02-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>175,493.08</td>\n" +
            "  <td>28,561.68</td>\n" +
            "  <td>2,074,230.69</td>\n" +
            "</tr><tr>\n" +
            "  <td>13</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-03-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>177,540.50</td>\n" +
            "  <td>26,514.26</td>\n" +
            "  <td>1,896,706.26</td>\n" +
            "</tr><tr>\n" +
            "  <td>14</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-04-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>179,611.80</td>\n" +
            "  <td>24,442.95</td>\n" +
            "  <td>1,716,911.23</td>\n" +
            "</tr><tr>\n" +
            "  <td>15</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-05-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>181,707.27</td>\n" +
            "  <td>22,347.48</td>\n" +
            "  <td>1,534,816.54</td>\n" +
            "</tr><tr>\n" +
            "  <td>16</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-06-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>183,827.19</td>\n" +
            "  <td>20,227.56</td>\n" +
            "  <td>1,350,392.78</td>\n" +
            "</tr><tr>\n" +
            "  <td>17</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-07-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>185,971.84</td>\n" +
            "  <td>18,082.91</td>\n" +
            "  <td>1,163,610.15</td>\n" +
            "</tr><tr>\n" +
            "  <td>18</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-08-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>188,141.51</td>\n" +
            "  <td>15,913.24</td>\n" +
            "  <td>974,438.49</td>\n" +
            "</tr><tr>\n" +
            "  <td>19</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-09-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>190,336.50</td>\n" +
            "  <td>13,718.26</td>\n" +
            "  <td>782,847.23</td>\n" +
            "</tr><tr>\n" +
            "  <td>20</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-10-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>192,557.09</td>\n" +
            "  <td>11,497.66</td>\n" +
            "  <td>588,805.44</td>\n" +
            "</tr><tr>\n" +
            "  <td>21</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-11-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>194,803.59</td>\n" +
            "  <td>9,251.16</td>\n" +
            "  <td>392,281.77</td>\n" +
            "</tr><tr>\n" +
            "  <td>22</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2019-12-15</td>\n" +
            "  <td>204,054.76</td>\n" +
            "  <td>197,076.30</td>\n" +
            "  <td>6,978.46</td>\n" +
            "  <td>193,244.47</td>\n" +
            "</tr><tr>\n" +
            "  <td>23</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2020-01-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>199,375.52</td>\n" +
            "  <td>4,679.23</td>\n" +
            "  <td>-8,338.60</td>\n" +
            "</tr><tr>\n" +
            "  <td>24</td>\n" +
            "  <td>租金</td>\n" +
            "  <td>2020-02-15</td>\n" +
            "  <td>204,054.75</td>\n" +
            "  <td>201,701.57</td>\n" +
            "  <td>2,353.18</td>\n" +
            "  <td>0.00</td>\n" +
            "</tr></table>]]></BODYTEXT><DRAFTERUSERID>ic1400036</DRAFTERUSERID>\n" +
            "    <DRAFTEREMPNO>03084474</DRAFTEREMPNO>\n" +
            "    <ISPUBLIC>Y</ISPUBLIC>\n" +
            "    <FORMNAME>季付/半年付工作申请禀议</FORMNAME>\n" +
            "  </DOC>\n" +
            "  <EXTRA>\n" +
            "    <ISTEMPSAVE>N</ISTEMPSAVE>\n" +
            "    <REDRAFT>N</REDRAFT>\n" +
            "    <AUTODRAFT>N</AUTODRAFT>\n" +
            "    <DRAFTSYNC>Y</DRAFTSYNC>\n" +
            "    <PROCESSSYNC>Y</PROCESSSYNC>\n" +
            "    <RETURNSYNC>Y</RETURNSYNC>\n" +
            "    <ISAPRLINE>Y</ISAPRLINE>\n" +
            "    <ISRECIPIENTCC>Y</ISRECIPIENTCC>\n" +
            "    <ISPROPERTY>Y</ISPROPERTY>\n" +
            "  </EXTRA>\n" +
            "  <PROPERTY>\n" +
            "    <SECURITYCODE>200</SECURITYCODE>\n" +
            "    <STORAGEPERIOD>5yr</STORAGEPERIOD>\n" +
            "    <ISEDMS>Y</ISEDMS>\n" +
            "    <DUEDATE></DUEDATE>\n" +
            "    <TAG>??</TAG>\n" +
            "    <TASKCODE></TASKCODE>\n" +
            "    <SUBCODE></SUBCODE>\n" +
            "  </PROPERTY><APRLINE><APPROVER>\n" +
            "      <USERID>ic1100656</USERID>\n" +
            "      <EMPNO></EMPNO>\n" +
            "      <DEPTID></DEPTID>\n" +
            "      <APRTYPE>Approve</APRTYPE>\n" +
            "    </APPROVER><APPROVER>\n" +
            "      <USERID>ic1000205</USERID>\n" +
            "      <EMPNO></EMPNO>\n" +
            "      <DEPTID></DEPTID>\n" +
            "      <APRTYPE>Approve</APRTYPE>\n" +
            "    </APPROVER></APRLINE><CC>\n" +
            "     <CCPOINT>\n" +
            "     <TYPE>USER</USERID>\n" +
            "     <USERID></APRTYPE>\n" +
            "     </CCPOINT>\n" +
            "     <CCPOINT>\n" +
            "     <TYPE>USER</USERID>\n" +
            "     <USERID></APRTYPE>\n" +
            "     </CCPOINT>\n" +
            "   </CC>\n" +
            "   <RECIPIENT>\n" +
            "     <RECIPIENTPOINT>\n" +
            "     <TYPE>USER</USERID>\n" +
            "     <USERID></APRTYPE>\n" +
            "     </RECIPIENTPOINT>\n" +
            "     <RECIPIENTPOINT>\n" +
            "     <TYPE>USER</USERID>\n" +
            "     <USERID></APRTYPE>\n" +
            "     </RECIPIENTPOINT>\n" +
            "     <RECIPIENTPOINT>\n" +
            "     <TYPE>USER</USERID>\n" +
            "     <USERID></APRTYPE>\n" +
            "     </RECIPIENTPOINT>\n" +
            "    </RECIPIENT>\n" +
            "</CONNROOT>";
    }



</script>
<body>
<button type="button" onclick="ConnData()">a</button>
</body>
</html>