InvoiceOCR_new.html 68.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script type="text/javascript" src="/mobile/plugin/browser/fna2/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="/mobilemode/browser/js/fastclick.min_wev8.js"></script>
	<script type="text/javascript" src="/mobile/plugin/browser/fna2/js/bootstrap.min.js"></script>
	<link type="text/css" rel="stylesheet" href="/mobile/plugin/browser/fna2/css/bootstrap.css"/>
	<script src="/formmode/js/jquery/form/jquery.form_wev8.js"></script>
	<style type="text/css">
		body ,html{
			font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"SimSun";
			background-color: #ffffff !important;
			overflow: auto;
			height: 100%;
			width: 100%;
		}
		.title{
			height: 50px;
			width: 100%;
			text-align: center;
			line-height: 50px;
			font-weight: bold;
			font-size: 18px;
			text-align: center;
		}
		.decrp{
			height: 30px;
			width: 100%;
			text-align: center;
			line-height: 30px;
			font-weight: bold;
			margin-top: 33%;
		}
		.square-shape,.square-shape-long {
			width: 33%;
			padding-top: 33%;
			float: left;
			background-size: 80% 80%;
		}
		.square-shape-long{
			width: 34%;
		}
		.detail,.detail-long{
			width: 33%;
			height: 100%;
			float: left;
			font-size: 12px;
		}
		.detail-long{
			width: 34%;
		}
		#container{
			display: none;
		}
		#result_img{
			width: 100%;
			height: 400px;
			float: left;
			overflow-y:auto;
			overflow-x:auto;
			overflow:auto;
			background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA5CAYAAAEdNnhXAAAAAXNSR0IArs4c6QAACC9JREFUaAXVmglXE0kQxzshKIcCgsByKS63eO/3f36C1bf65JJTBZQ7yE0gO7+O1enpmckkk0Sh3kump7urq6uP6qp/TyqbPcwvLMyro6Mj5dKbN/+oDIXj4xNumX5/9+5flRZOXsIoLZk0J3R9fS1JlSEl3M+ePVeNjY0qnTZ8hQo2t2H9lUh3d3fr5OnpqVum31OoeXl5GarmgwcPlK4gfbCb6O8fUKnl5eV8V9dDO9+kDWcmk1EvXrw0BSR0oS/He2HA7t27V9S7tfWeOj4+UqhIAaS1J0MKdO6vv/Ty8pJO3r3bZOfrtJa5v78fKPDp+fjxYxWlksv56dMndX5+ptIMEH2C8eoqZybNZbDfp6en9WtxOr3XhoaMGh4etuuVTOslYtfo7OyyX309YQgZY6HU27dv87y8fPnKk9yg83d2dtSXL2taHanoPlFXS3bXXhyjNGTWRiqVUh0dHeri4tIry6s7d+5IncBTpk4zM+wzMzMqn9caBCrbGTTK9oEyHz78p3K5nHr9+o1CehxdXFzoQXz+/IVKw4jO5TDSMJKp//Hjh8LCFWmMYNiuknL36VskbmHcu2+RvHr1uuzu07BPMsYnSveTkxNvM5z7OuOT7CvxXlZWlpXMaUtLi54VRltIM29ubqrNzQ3JU5OTU2publZhVNzVJ5XM8szlLn2VKGhvb1cjI6NSN/SpdR4aehQojGOEwTdgZCA1qquU2xRgtgvj0qm5ufk8g8WOYprEoEYxnp9fqJOTY907Y5EPDg7K3FWNCgMNGWbZXVESa5U/MTHpCW9Vqa2trTxmGCp3kJN24tu3b2pr64dmT2N8IOxIvWlwcNCIyIjFc/eha06amprU06eFM8ZwV5GIXJqjo/7dVM4mqaQfkUakra29rnMeKbiS3m9srKvv37+XZMGvGxsbN3USCWZdvH//zjTC9sDtwlJGEeZ3Zqawe6hjPIIohqj8cqxqGK8sWtPFuD28tLSkstkDrZXrVIYJiMszgktVxK1BaHt7h3d2jJSqWnZZWuYFnyKKcMagWgmlrbQMG7b6+PiYPB/JmdzV5XclfZXKfEEGxPluDom9vT21urpSZhPJqtlBhxFMU+zFnZ1tz+MsehrJRBS5MMVsN2IHO/LQghni+fm5Yu06pXwa7+zs5nE6IXo0NjZW0reutE8Ym729XbW2tqZZRXhGhPb09Cr72KpUQFR9hpooix/Gg92jQzBhqIdQaVuezDOE9pHHolSu5VOiO9ZUpOXCoJ+dnWm5tbJY4mww76EaX11dGaFIxlzWmkIFA17Um0IF41/ZJAG0nVdtOnKOOSbx7gnIsK21pkjBCBIoptZCaa+k4CQCCUlZI4wUU2bjZ3Z7VQtmy33+vKCF2Q276e7uHjU0NGSyEwtGKzG3pjUvAejAT7akBAzb21uKn1AiwWtrq2p3d1fa8I68Yc8WRzsK4JlLS4vq58+fhscIxowRVAHluYTF6e3tVeCMs7MzShDMwcEh1dPT41YPvDPP4lMHvMxS5zHDhZNgO+02QBaQVEaG0ZhzktMDu+wSx9ji4qIBUeJcYZc/7N0IFqcvrBIOgiA309PPwqpUnBdqMt1WAHKglpZWz0u56xYnei9LMFgVNDk5mUhIGFOsYIAVCIy3lhQr+MePQvgpbks1wiVaYSHHCpboAjyqWiIGgwDr03LkSXhRbeNR/Cgg0wYeqB16sSYwFVZuEbPmTIaSHpEYn2w2awC4vr5+1dfXV4ydfgfANjz8RHV2dmpFfLETOdjqAlqvy6v+w84TO4GB2BQQzHG3vr6uww674m1L48MPDAxEK8yi43JRzu3bpmBUf5lpLkyZbUjP8OrqamBGiR37+/sjXbUoAX86H19nY2PDYMTSH2Z82LvUS83PL+TBA4U4eKempm6dotJ/eaL47OysDsQlD78tDdBiEzBElANu17vp6YJzOebrJrpmXFQJPzyOGD2OaO8q3rOs56q5udk75TrVw4fhF+tx7dWr3NUFXSv2ZMD9wP9sIjbgxxEPfMP+v6kU6/PYHccbcJW1y0kT/7ACbipVpDBuj7tMXMVwBm+yDah4SfNpAZj5169fNBwpCoM2EB7LeSf5N+1ZscIogBvO7zZSRUv6Niro9jnRDLuN1PIdMOfwMOtBmMceanxq0IcoGYADTU3Neiu1tbXFQp5/VGHABT5bqQYCB47hRxu2x8gA3b9/PzBOv13h7e1t3TFAxijC8GHtuadnBqOsPoEOg8aP8JIA2G7Xxg5FVqzChYuhc88iX3qQbE7DsqShdLpBf+/GUUXH8LjCOkcnVlaWvaV6KHLNE+tOdJ7ECErMywDJF5rSMD4D3/C4Sgeu5kFgBI0R5qRPApHr66sAdk3+6OiIvkJM2na5fDasAk9ghl1lGUVmgR+zyAUM2Fo+f/1rtguzzrJyb4nAWm1iFsI++LLr1DsdUJiYsaPDg7s8KDsJYUC4DLSBBJb6+PiEHqwkbdaSJ6CwXG8mEYLRWPIuGmx68uTvRPvTbqOW6YDCSRsHInKVZVaTwo5J+xHHl2zdOq1ihblYs4mbnZumLP2ricI4D3ZIyLYIO/TtAflT6TQGxaaws9Iud9Moat9KYtUfPQp+euvy/Y53VxftJwwMFD/GpBOLi5/NZ8zldIq9a1tkvKOkFr4ceeXWIYRFF5vQNYPDzX6z9yBe0Yr3BRdQDfcTpT5+kG9RpOE4gEDq1eOZy+X0xa58xmvLQEe2me/mgRsHuT+zK9/mdG/vX/oGQnTwKSyZWF2c/P39PXP3LmU3/ck+BUHFqwtbmf8DIKS3YKUwBbMAAAAASUVORK5CYII=) no-repeat center #f1f1f2;
			border-top: 1px solid #c5c5c5;
			border-bottom: 1px solid #c5c5c5;
		}
		#img-div{
			width: 100%;
			height: 100%;
			overflow-y:auto;
			overflow-x:auto;
			overflow:auto;
		}
		#footer-div{
			width: 90%;
			height: 40px;
			margin-left: 5%;
			margin-top: 420px;
			margin-bottom: 30px;
		}
		#btn_submit,#btn_pre{
			width: 50%;
			height: 100%;
			font-size: 15px;
			font-weight: bold;
			float: left;
		}
		#btn_select,#btn_add{
			width: 100%;
			height: 100%;
			font-size: 15px;
			font-weight: bold;
			float: left;
		}
		#btn_pre_check{
			width: 33%;
			height: 100%;
			font-size: 15px;
			font-weight: bold;
			float: left;
			background-color: #5bc0de;
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			border-top-left-radius: 0;
			border-bottom-left-radius: 0;
			border: none;
			color: #fff;
		}
		#btn_check_close{
			width: 33%;
			height: 100%;
			font-size: 15px;
			font-weight: bold;
			float: left;
			background-color: #d9544f;
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			border: none;
			color: #fff;
		}
		#btn_pre{
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			background-color: #5bc0de;
			border: none;
			color: #fff;
		}
		#btn_select,#btn_add{
			border-color: #000;
			color: #fff;
			border: none;
			border-top-left-radius: 0;
			border-bottom-left-radius: 0;
		}
		#btn_submit{
			background-color: #d9544f;
			border: none;
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			color: #fff;
		}

		#container3{
			width: 98%;
			height: 200px;
			margin-top: 10px;
			margin-left: 1%;
			background-color: #fff;
			display: none;
		}
		.row-line{
			height: 50px;
			width: 100%;
			line-height: 50px;
			float: left;
		}
		.img-div{
			height: 100%;
			width: 12%;
			background: url("/fna/invoice/image/Field_identifier.png") no-repeat center;
			float: left;
			background-size: 20px 20px;
		}
		.info-div{
			height: 100%;
			width: 84%;
			margin-right: 4%;
			border-bottom: 1px solid #f1f4f6;
			float: right;
		}
		.label-div{
			height: 100%;
			width: 30%;
			float: left;
			font-size: 12px;
			font-weight: bold;
		}
		.text-div{
			height: 100%;
			width: 70%;
			float: right;
			font-size: 12px;
			line-height: 50px;
		}
		#footer-div-check{
			width: 90%;
			height: 40px;
			margin-left: 5%;
			margin-right: 5%;
			bottom: 50px;
			position: fixed;
		}
		#btn_check{
			width: 33%;
			height: 100%;
			font-size: 15px;
			font-weight: bold;
			border-top-left-radius: 0;
			border-bottom-left-radius: 0;
			border: none;
			color: #fff;
		}
		.text-input{
			width: 100%;
			height: 30px;
			margin-top: 10px;
		}
		.info-text{
			display: none;
		}
		#dynamic_1{
			display: none;
		}
		#container2,#container3{
			height:95%;
		}
		#container4,#container5,#container6,#container7,#container8,#container9,#container10,#container11,#container12,#container13,#container14{
			width: 90%;
			height:95%;
			margin-left: 5%;
			margin-top:5%;
			display: none;
			overflow-y:auto;
			overflow:auto;
		}
		.title-div{
			height: 50px;
			line-height: 50px;
			text-align: center;
			font-weight: bold;
			font-size: 18px;
		}
		.div-2,.div-4{
			height: 20px;
			line-height: 20px;
		}
		.type-div{
			width: 50%;
			height: 100%;
			float: left;
			/* 	color: #9e9e9e; */
		}
		.div-3{
			height: 45px;
			width: 100%;
			vertical-align:middle;
			line-height: 45px;
		}
		.div-3-d1{
			width: 50%;
			height: 100%;
			float: left;
		}
		.div-3-d2{
			width: 100%;
			float: right;
			margin-top:15px;
			text-align: right;
			height: 40px;
		}
		.btn-primary{
			width: 100%;
			background-color: #174c8e;
		}
		.div-4-d1{
			width: 50%;
			height: 100%;
			float: left;
			/* 	color: #9e9e9e; */
		}
		.div-4-d2{
			width: 50%;
			height: 100%;
			float: right;
			/* 	color: #9e9e9e; */
			/* 	margin-bottom: 30px; */
		}
		.div-3-d1-d1{
			width: 50%;
			height: 100%;
			float: left;
			/* 	font-weight: bold; */
		}
		.div-3-d1-d2{
			width: 100%;
			height: 100%;
			/* 	font-weight: bold; */
		}
		#span2{
			color: #ec6174;
			font-size: 18px;
			font-weight: bold;
		}
		#span3,#span4{
			font-size: 18px;
			font-weight: bold;
		}
		#span5,#span6,#span7,#span8,#span9{
			color: #696969;
		}
		#container5 .form-control{
			width: 90%;
		}
		#container6 .form-control{
			width: 90%;
		}
		#container7 .form-control{
			width: 90%;
		}
		#container8 .form-control{
			width: 90%;
		}
		#container9 .form-control{
			width: 90%;
		}
		#container10 .form-control{
			width: 90%;
		}
		#container11 .form-control{
			width: 90%;
		}
		#container12 .form-control{
			width: 90%;
		}
		#container13 .form-control{
			width: 90%;
		}
		#container14 .form-control{
			width: 90%;
		}
		.dv1,.dv3 {
			width: 50px;
			height: 100%;
			float: left;
			text-align: center;
			line-height: 50px;
			font-size: 14px;
		}
		.dv3 {
			float: right;
		}
		.dv2 {
			width: 70%;
			height: 100%;
			float: left;
			line-height: 50px;
			text-align: center;
			font-weight: bold;
		}
	</style>
</head>
<body style="height:500 px;overflow: auto;">
	<form id="form1" enctype="multipart/form-data" name="form1" method="post" action="/mobile/plugin/1/fna/imageOCRAjax.jsp" target="rfFrame">
		<input type="text" value="" name="uploaddata" id="uploaddata" style="display: none;">
		<input type="text" value="" name="uploadname" id="uploadname" style="display: none;">
		<input type="text" value="getbase64" name="operate" style="display: none;">
	</form>
	<iframe id="rfFrame" name="rfFrame" style="display:none;"></iframe>
	<!-- 上传发票图片 -->
	<div id="container2">
		<div class="title">
			请选择发票
		</div>
		<div id="result_img">
			<div id="img-div">
				
			</div>
		</div>
		<div id="footer-div">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div onclick="uploadimage();" style="height: 100%;width: 50%;float: left;">
				<button type="button" class='btn btn-primary' id='btn_select'>选择发票</button>
				<input type="file" accept="image/*" name='file_head' id="file_head" style="position:absolute;opacity:0;margin-top: 0px;height: 40px;width: 30%;margin-right:30%;">
			</div>
		</div>
	</div>
	<!-- 手动验票页面 -->
	<div id="container3">
		<div class="title">请手动输入验票</div>
		<div class="row-line">
			<div class='img-div'></div>
			<div class="info-div">
				<div class="label-div">发票代码</div>
				<div class="text-div">
					<input onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')"
					id="fpdm" onblur="fpdmBlur();" onfocus="inputFocus();" maxlength="12" type="text" class="form-control text-input" autocomplete="off" placeholder="请输入发票代码">
				</div>
			</div>
		</div>
		<div class="row-line">
			<div class='img-div'></div>
			<div class="info-div">
				<div class="label-div">发票号码</div>
				<div class="text-div">
					<input onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')"
					id="fphm" onblur="fphmBlur();" onfocus="inputFocus();" maxlength="8" type="text" class="form-control text-input" autocomplete="off" placeholder="请输入发票号码">
				</div>
			</div>
		</div>
		<div class="row-line">
			<div class='img-div'></div>
			<div class="info-div">
				<div class="label-div">开票日期</div>
				<div class="text-div">
					<input onblur="rqBlur();" id="checkDate" type="date" class="form-control text-input" autocomplete="off" />
				</div>
			</div>
		</div>
		<div class="row-line" id="dynamic_2">
			<div class='img-div'></div>
			<div class="info-div">
				<div class="label-div">开具金额</div>
				<div class="text-div">
					<input maxlength="9" id="je" onfocus="inputFocus();" type="text" onblur="jeBlur();" onkeyup="clearNoNum(this)" class="form-control text-input" placeholder="请输入开具金额" autocomplete="off">
				</div>
			</div>
		</div>
		<div class="row-line" id="dynamic_1">
			<div class='img-div'></div>
			<div class="info-div">
				<div class="label-div">校验码后6位</div>
				<div class="text-div">
					<input onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')" 
					id="jym" onblur="jymBlur();" onfocus="inputFocus();" maxlength="6" type="text" class="form-control text-input" placeholder="请输入校验码后六位" autocomplete="off">
				</div>
			</div>
		</div>

		<div id="footer-div-check">
			<button type="button" class='btn btn-primary' id='btn_check_close' onclick="onBack();">关闭</button>
			<button type="button" class='btn btn-primary' id='btn_pre_check' onclick="pre_check_page();">上一步</button>
			<button type="button" class='btn btn-primary' id='btn_check' onclick="onCheck_auto();">自动查验</button>
		</div>
	</div>
	<!--所有发票的imageID-->
	<input type="hidden" name="imageID" id="imageID" value="">
	<!-- 增值税发票信息页面 -->
	<div id="container4">
		<input class="info-text" type="text" id="fplx">
		<input class="info-text" type="text" id="_taxRate">
		<input class="info-text" type="text" id="_invoiceServiceYype">
		<input class="info-text" type="text" id="_checkCode">
		<div class="title-div">
				<span id="span1"></span>
			<img style="width: 50px;height: 28px;margin-left: 10px;" src="/fna/invoice/image/access.png">
			</div>
			<div class="div-2"><div class="type-div">价税合计</div></div>
			<div class="div-3">
				<div class="div-3-d1">
					<span style="color: #ec6174"></span><span id="span2"></span>
				</div>
			</div>
			<div class="div-4">
				<div class="div-4-d1">金额</div>
				<div class="div-4-d2">税额</div>
			</div>
			<div class="div-3">
				<div class="div-3-d1-d1">
<span id="span3"></span>
				</div>
				<div class="div-3-d1-d1">
<span id="span4"></span>
				</div>
			</div>
			<div class="div-4">
				<div class="div-4-d1">发票号码</div>
				<div class="div-4-d2">发票代码</div>
			</div>
			<div class="div-3">
				<div class="div-3-d1-d1">
					<span id="span5"></span>
				</div>
				<div class="div-3-d1-d1">
					<span id="span6"></span>
				</div>
			</div>
			<div class="div-2"><div class="type-div">购买方</div></div>
			<div class="div-3">
				<div class="div-3-d1-d2">
					<span id="span7"></span>
				</div>
			</div>
			<div class="div-2"><div class="type-div">销售方</div></div>
			<div class="div-3">
				<div class="div-3-d1-d2">
					<span id="span8"></span>
				</div>
			</div>
			<div class="div-2"><div class="type-div">开票日期</div></div>
			<div class="div-3">
				<div class="div-3-d1-d2">
					<span id="span9"></span>
				</div>
			</div>
			<div class="div-3-d2" >
				<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
				<div  style="height: 100%;width: 50%;float: left;">
					<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
				</div>

			</div>
	</div>
	<!-- 火车票展示页面 -->
	<div id="container5">
		<div class="title-div">
			<span id="span1">火车票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container5-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">出发站</div>
			<div class="div-4-d2">到达站</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container5-cfz">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container5-ddz">
			</div>
		</div>
		<div class="div-2"><div class="type-div">号码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container5-hm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">座位类型</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container5-zwlx">
			</div>
		</div>
		<div class="div-2"><div class="type-div">出发日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container5-cfsj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">时间</div></div>
		<div class="div-3">
		<div class="div-3-d1-d2">
			<input type="text" class="form-control" id="container5-sj">
		</div>
	</div>
		<div class="div-2"><div class="type-div">车次</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container5-cc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">乘车人</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container5-ccr">
			</div>
		</div>
 		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
 		</div> 
	</div>
	<!-- 出租发票展示页面 -->
	<div id="container6">
		<div class="title-div">
			<span id="span1">出租车发票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container6-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">发票号码</div>
			<div class="div-4-d2">发票代码</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container6-fphm">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container6-fpdm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">上车时间</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container6-scsj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">下车时间</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container6-xcsj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">里程</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container6-lc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">开票日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container6-kprq">
			</div>
		</div>
 		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
 		</div>
	</div>
	<!-- 定额发票展示页面 -->
	<div id="container7">
		<div class="title-div">
			<span id="span1">定额发票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container7-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">发票号码</div>
			<div class="div-4-d2">发票代码</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container7-fphm">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container7-fpdm">
			</div>
		</div>
 		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
 		</div>
	</div>
	<!-- 通用机打发票展示页面 -->
	<div id="container8">
		<div class="title-div">
			<span id="span1">通用机打发票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container8-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">发票号码</div>
			<div class="div-4-d2">发票代码</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container8-fphm">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container8-fpdm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">开票日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container8-kprq">
			</div>
		</div>
		<div class="div-2"><div class="type-div">销售方名称</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container8-xsfmc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">销售方纳税人识别号</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container8-xsfnsrsbh">
			</div>
		</div>
		<div class="div-2"><div class="type-div">购买方方名称</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container8-gmfmc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">购买方纳税人识别号</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container8-gmfnsrsbh">
			</div>
		</div>
 		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
 		</div> 
	</div>
	<!-- 二手车/机动车销售发票展示页面 -->
	<div id="container9">
		<div class="title-div">
			<span id="span1">二手车销售统一发票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container9-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">发票号码</div>
			<div class="div-4-d2">发票代码</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container9-fphm">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container9-fpdm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">销售方名称</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container9-xsfmc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">购买方名称</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container9-gmfmc">
			</div>
		</div>
		<div class="div-2"><div class="type-div">开票日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container9-kprq">
			</div>
		</div>
 		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
 		</div>
	</div>
	<!--小票展示页面 -->
	<div id="container10">
		<div class="title-div">
			<span id="span1">小票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">总金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container10-zje">
			</div>
		</div>
		<div class="div-2"><div class="type-div">店名</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container10-dm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">消费类型</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container10-xflx">
			</div>
		</div>
		<div class="div-2"><div class="type-div">日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container10-rq">
			</div>
		</div>
		<div class="div-2"><div class="type-div">时间</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container10-sj">
			</div>
		</div>
		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
		</div>
	</div>
	<!-- 客运汽车票展示页面 -->
	<div id="container11">
		<div class="title-div">
			<span id="span1">客运汽车票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container11-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">出发站</div>
			<div class="div-4-d2">到达站</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container11-cfz">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container11-ddz">
			</div>
		</div>
		<div class="div-2"><div class="type-div">号码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container11-hm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">代码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container11-dm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">出发日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container11-cfsj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">时间</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container11-sj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">乘车人</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container11-ccr">
			</div>
		</div>
		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
		</div>
	</div>
	<!--过路费票展示页面 -->
	<div id="container12">
		<div class="title-div">
			<span id="span1">过路费票</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container12-je">
			</div>
		</div>
		<div class="div-4">
			<div class="div-4-d1">入口</div>
			<div class="div-4-d2">出口</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container12-rk">
			</div>
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container12-ck">
			</div>
		</div>
		<div class="div-2"><div class="type-div">号码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container12-hm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">代码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container12-dm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container12-cfsj">
			</div>
		</div>
		<div class="div-2"><div class="type-div">时间</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container12-sj">
			</div>
		</div>
		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
		</div>
	</div>
	<!--航空运输电子客票行程单展示页面 -->
	<div id="container13">
		<div class="title-div">
			<span id="span1">航空运输电子客票行程单</span>
		</div>
		<div class="div-4">
			<div class="div-4-d1">金额</div>
		</div>
		<div class="div-3">
			<div class="div-3-d1-d1">
				<input type="text" class="form-control" id="container13-je">
			</div>
		</div>
		<div class="div-2"><div class="type-div">号码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container13-hm">
			</div>
		</div>
		<div class="div-2"><div class="type-div">开票日期</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="date" class="form-control" id="container13-kprq">
			</div>
		</div>
		<div class="div-2"><div class="type-div">校验码</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container13-jym">
			</div>
		</div>
		<div class="div-2"><div class="type-div">乘机人姓名</div></div>
		<div class="div-3">
			<div class="div-3-d1-d2">
				<input type="text" class="form-control" id="container13-cjrxm">
			</div>
		</div>

		<div class="div-3-d2">
			<button type="button" class='btn btn-primary' id='btn_submit' onclick="onBack();">关闭</button>
			<div  style="height: 100%;width: 50%;float: left;">
				<button class="btn btn-primary" type="button" id='btn_add' onclick="onSave();">添加至流程</button>
			</div>
		</div>
	</div>
	<div id="image-select" style="position: absolute;top: 60%;left: 5%;width: 90%;height:35%;bottom:5%;background-color: #fff;opacity:1;z-index: 10001;border-radius:10px;border: 1px solid #eeeeee;display: none;">
		<div style="width: 100%;height: 33%;border-bottom: 1px solid #eeeeee;" onclick="takePicture(event,this);">
			<div style="width:20%;height:100%;background: url('/mobilemode/images/mec/photograph_wev8.png') no-repeat center;float: right;"></div>
			<div style="width:80%;height:100%;float: left;background: url('/fna/invoice/mobilepage/img/pz.png') no-repeat left;background-size:40px 40px;background-position: 10px;"></div>
		</div>
		<div style="width: 100%;height: 33%;border-bottom: 1px solid #eeeeee;" onclick="photoAlbum(event,this);">
			<div style="width:20%;height:100%;background: url('/mobilemode/images/mec/photochoose_wev8.png') no-repeat center;float: right;"></div>
			<div style="width:80%;height:100%;float: left;background: url('/fna/invoice/mobilepage/img/zptk.png') no-repeat left;background-size:80px 40px;background-position: 10px;"></div>
		</div>
		<div style="width: 100%;height: 33%;background: url('/fna/invoice/mobilepage/img/qx.png') no-repeat center;background-size:40px 40px;" onclick="cancel();"></div>
	</div>
<script type="text/javascript">
	//invoiceScanner.jsp调用该方法,从而该页面可以获得下方三个参数
    var _fna_requestid = "";
    var _fna_dindex = "";
    var _fna_workflowid = "";
    var editPage = "";
    function resetBrowser(obj){
        if(obj != null){
            _fna_requestid = obj["requestid"] || "";
            _fna_dindex = obj["dindex"] || "";
            _fna_workflowid = obj["workflowid"] || "";

        }

    }

    var jsonToSaveAdd="";
	var _invoiceType = "";
	var imgsrc = "0";
	//手动验票页面############################################################################
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isEMobile = u.indexOf('E-Mobile') > -1;
	var fplx = 0;
	var jyfpdm = 0;
	var jyfphm = 0;
	var jyjym = 0;
	var jyje = 0;
	var ifcheckCode = 0;
	//手动验票页面############################################################################

	$(function(){
		
		if(isAndroid){
			$(".form-control").focus(function(){
				$('.btn-primary').css('position', 'static');
			});
			$(".form-control").blur(function(){
				$('.btn-primary').css('position', '');
			});
		}
        if(isAndroid && isEMobile){//emobile且为安卓客户端,屏蔽inputfile
            $("#file_head").remove();
        }

	});
	jQuery(function(){
		jQuery('input[name=file_head]').on('change', function(){
			var file = this.files[0];
			if(!isCanvasSupported()){
				var imgFile;
				var reader = new FileReader();
				reader.onload=function(e) {
					imgFile = e.target.result;
	   			    var img = new Image();
	   		     	img.src = imgFile; 
	   		     	img.id = 'imgPicture';
	   		     	img.style.height = "100%";
	   		     	img.style.width = "100%";
	   		     	jQuery("#img-div").empty();
	   		     	jQuery("#img-div").append(img);
		     			imgsrc = "1";
				};
				reader.readAsDataURL(file);
			}else{
				compress(event, function(base64Img){
	 				//console.log(base64Img);
	 				var img = new Image();
                    img.src = base64Img;
                    img.id = 'imgPicture';
                    img.style.height = "100%";
                    img.style.width = "100%";
                    jQuery("#img-div").empty();
                    jQuery("#img-div").append(img);
                    imgsrc = "1";
				});
			}
			$("#fpdm").val("");
			$("#fphm").val("");
			$("#checkDate").val("");
			$("#je").val("");
			$("#jym").val("");
			setTimeout(check,1000);
		});
	});
	
	function pre_page(){

		$("#container2").hide();
	}
	
	function pre_check_page(){
		$("#container2").show();
		$("#container3").hide();
	}

	function compress(event, callback) {
		if ( typeof (FileReader) === 'undefined') {
			alert("当前浏览器内核不支持base64图标压缩");
		} else {
			try {
				var file = event.currentTarget.files[0];
				var reader = new FileReader();
				reader.onload = function (e) {
					var image = $('<img/>');
					image.load(function () {
						//console.log("开始压缩");
						var square = 1000;
						var canvas = document.createElement('canvas');
						var context = canvas.getContext('2d');
						var imageWidth;
						var imageHeight;
						if (this.width > this.height) {
						  imageWidth = Math.round(square * this.width / this.height);
						  imageHeight = square;
						} else {
						  imageHeight = Math.round(square * this.height / this.width);
						  imageWidth = square;
						}
						context.clearRect(0, 0, imageWidth, imageHeight);
						canvas.width = imageWidth;
						canvas.height = imageHeight;
						context.drawImage(this, 0, 0,imageWidth,imageHeight);
						var data = canvas.toDataURL('image/jpeg');
						callback(data);
					});
					image.attr('src', e.target.result);
				};
				reader.readAsDataURL(file);
			} catch(e) {
				//console.log("压缩失败!");
			}
		}
	}

	function isCanvasSupported() {
		var elem = document.createElement('canvas');
		return !!(elem.getContext && elem.getContext('2d'));
	}

	function check(){

		if(imgsrc == "0"){
			alert("请先选择发票!");
			return;
		}
		loading();
		jQuery.ajax({
            url: '/mobile/plugin/1/fna/imageOCRAjax.jsp',
            type: 'post',
            data: {img:jQuery("#imgPicture").attr("src"),operate:"callOcr",requestid:_fna_requestid},
            dataType: 'json',
            timeout: 60000,
            success: function (_json) {
            	if(_json!=null && ""!=_json && _json.flag){
                    jsonToSaveAdd=_json.data[0];
					_fna_imageOCRAjax_callBack(_json);
            	}else{
                    alert(_json.msg);
                    return false;
				}
            },
            error: function (XHR, textStatus, errorThrown) {
            	loaded();
				alert("验票失败,请进行手动输入验票!");
				$("#container3").show();
				$("#container2").hide();
            },
            complete:function(){
            	loaded();
            }
        });
	}

	function _fna_imageOCRAjax_callBack(_json){
try{
    //_json.error用来判断验票是否超时,如果超时,跳到编辑页面
	if (_json.error != "" && _json.error != null) {
		alert("发票验证失败!");
	} else {
		//_json.flag
		if (_json.flag) {
			//跳转到发票信息页面
			editPage = _json.editPage;
			console.log(editPage);
			var imageID=_json.data[0].imageID;
            $("#imageID").val(imageID);
			if (editPage) {//需要编辑

				if (_json.data[0].type=="10101" || _json.data[0].type=="10102" || _json.data[0].type=="10103" || _json.data[0].type=="10100") {

				    alert("当前发票有字段未识别出,请在手动验票页面填写未识别出字段!");
					showCheckPage();
					var data = _json.data;
					_invoiceType = data[0].type;
					var _invoiceNumber = data[0].invoiceNumber;
					var _invoicecode = data[0].invoiceCode;
					var _billingDate = data[0].billingDate;
					if (_invoiceType == "10101" || _json.data[0].type=="10102" || _json.data[0].type=="10103") {
						var _checkCode = data[0].checkCode;
						blurs(_invoiceType, _invoiceNumber, _invoicecode, _checkCode.substring(14), _billingDate, "");
					} else {
						var _priceWithoutTax = data[0].priceWithoutTax;
						blurs(_invoiceType, _invoiceNumber, _invoicecode, "", _billingDate, _priceWithoutTax);
					}
				} else {
					showCorrectInfoPage(_json.data[0].type);
					//跳转
					var data = _json.data;
					if (data[0].type=="10400") {
						_invoiceType = data[0].type;
                        var _invoiceNumber = data[0]._number;
                        var _invoicecode = data[0]._code;
                        var _billingDate = data[0]._date;
                        var _taxIncludedPrice = data[0]._total;
                        var time = data[0]._time;
                        var check_code = data[0]._check_code;
                        var category = data[0]._category;
                        var seller = data[0]._seller;
                        var seller_tax_id = data[0]._seller_tax_id;
                        var buyer = data[0]._buyer;
                        var buyer_tax_id = data[0]._buyer_tax_id;
						$("#container8-je").val(_taxIncludedPrice);
						$("#container8-fpdm").val(_invoicecode);
						$("#container8-fphm").val(_invoiceNumber);
						$("#container8-kprq").val(_billingDate.replace("年", "-").replace("月", "-").replace("日", ""));
						$("#container8-xsfmc").val(seller);
						$("#container8-xsfnsrsbh").val(seller_tax_id);
						$("#container8-gmfmc").val(buyer);
						$("#container8-gmfnsrsbh").val(buyer_tax_id);
					} else if (data[0].type=="10105" || data[0].type=="10104") {
					    if(data[0].type=="10104"){
                            $("#container9 .title-div #span1").text("机动车销售统一发票");
						}
						_invoiceType = data[0].type;
						var _invoiceNumber = data[0]._number;
						var _invoicecode = data[0]._code;
						var _billingDate = data[0]._date;
						var _taxIncludedPrice = data[0]._total;
						var _payee = data[0]._seller;
						var _buyer = data[0]._buyer;
						$("#container9-je").val(_taxIncludedPrice);
						$("#container9-fphm").val(_invoiceNumber);
						$("#container9-fpdm").val(_invoicecode);
						$("#container9-kprq").val(_billingDate.replace("年", "-").replace("月", "-").replace("日", ""));
						$("#container9-xsfmc").val(_payee);
						$("#container9-gmfmc").val(_buyer);
					} else if (data[0].type=="10200") {
						_invoiceType = data[0].type;
                        var _invoiceNumber = data[0]._number;
                        var _invoicecode = data[0]._code;
                        var _taxIncludedPrice = data[0]._total;
                        $("#container7-je").val(_taxIncludedPrice);
                        $("#container7-fpdm").val(_invoicecode);
                        $("#container7-fphm").val(_invoiceNumber);
					} else if (data[0].type=="10500") {
						_invoiceType = data[0].type;
						var _invoiceNumber = data[0]._number;
						var _invoicecode = data[0]._code;
						var _billingDate = data[0]._date;
						var _getontime = data[0]._time_geton;
						var _getofftime = data[0]._time_getoff;
						var _mileage = data[0]._mileage;
						var _taxIncludedPrice = data[0]._total;
						$("#container6-fphm").val(_invoiceNumber);
						$("#container6-fpdm").val(_invoicecode);
						$("#container6-kprq").val(_billingDate.replace("年", "-").replace("月", "-").replace("日", ""));
						$("#container6-scsj").val(_getontime);
						$("#container6-xcsj").val(_getofftime);
						$("#container6-lc").val(_mileage);
						$("#container6-je").val(_taxIncludedPrice);
					} else if (data[0].type=="10503") {
						_invoiceType = data[0].type;
						var _startStation = data[0]._station_geton;
						var _arrivalStation = data[0]._station_getoff;
						var _startDate = data[0]._date;
						var _trains = data[0]._train_number;
						var _passenger = data[0]._name;
						var _taxIncludedPrice = data[0]._total;
						var number = data[0]._number;
						var time = data[0]._time;
						var seat = data[0]._seat;
						$("#container5-je").val(_taxIncludedPrice);
						$("#container5-cfz").val(_startStation);
						$("#container5-ddz").val(_arrivalStation);
						$("#container5-hm").val(number);
						$("#container5-zwlx").val(seat);
						$("#container5-cfsj").val(_startDate.replace("年", "-").replace("月", "-").replace("日", ""));
						$("#container5-cc").val(_trains);
						$("#container5-ccr").val(_passenger);
						$("#container5-sj").val(time);
					}else if(data[0].type=="10505"){
                        _invoiceType = data[0].type;
                        var _startStation = data[0]._station_geton;
                        var _arrivalStation = data[0]._station_getoff;
                        var _startDate = data[0]._date;
                        var _passenger = data[0]._name;
                        var _taxIncludedPrice = data[0]._total;
                        var number = data[0]._number;
                        var _invoicecode = data[0]._code;
                        var time = data[0]._time;
                        $("#container11-je").val(_taxIncludedPrice);
                        $("#container11-cfz").val(_startStation);
                        $("#container11-ddz").val(_arrivalStation);
                        $("#container11-hm").val(number);
                        $("#container11-dm").val(_invoicecode);
                        $("#container11-cfsj").val(_startDate.replace("年", "-").replace("月", "-").replace("日", ""));
                        $("#container11-ccr").val(_passenger);
                        $("#container11-sj").val(time);
					}else if(data[0].type=="10507"){
                        _invoiceType = data[0].type;
                        var _startStation = data[0]._entrance;
                        var _arrivalStation = data[0]._exit;
                        var _startDate = data[0]._date;
                        var _passenger = data[0]._name;
                        var _taxIncludedPrice = data[0]._total;
                        var number = data[0]._number;
                        var _invoicecode = data[0]._code;
                        var time = data[0]._time;
                        $("#container12-je").val(_taxIncludedPrice);
                        $("#container12-rk").val(_startStation);
                        $("#container12-ck").val(_arrivalStation);
                        $("#container12-hm").val(number);
                        $("#container12-dm").val(_invoicecode);
                        $("#container12-cfsj").val(_startDate.replace("年", "-").replace("月", "-").replace("日", ""));
                        $("#container12-sj").val(time);
                    }else if(data[0].type=="20100"){
                        _invoiceType = data[0].type;
                        var _total=data[0]._total;
                        var _storename=data[0]._storename;
                        var _type=data[0]._type2;
                        var _date = data[0]._date;
                        var _time = data[0]._time;
                        $("#container10-zje").val(_total);
                        $("#container10-dm").val(_storename);
                        $("#container10-xflx").val(_type);
                        $("#container10-rq").val(_date.replace("年", "-").replace("月", "-").replace("日", ""));
                        $("#container10-sj").val(_time);
					}else if(data[0].type=="10506"){
                        _invoiceType = data[0].type;
                        var _total=data[0]._total;
                        var _invoiceNumber=data[0]._number;
                        var _checkCode=data[0]._code;
                        var _date = data[0]._date;
                        var _user_name=data[0]._user_name;
                        $("#container13-je").val(_total);
                        $("#container13-hm").val(_invoiceNumber);
                        $("#container13-jym").val(_checkCode);
                        $("#container13-kprq").val(_date.replace("年", "-").replace("月", "-").replace("日", ""));
                        $("#container13-cjrxm").val(_user_name);
                    }
					//onSave();
				}
			} else {

				if (_json.data[0].type=="10101" || _json.data[0].type=="10102" || _json.data[0].type=="10103" || _json.data[0].type=="10100") {

					//showCheckPage();
					var data = _json.data;
					_invoiceType = data[0].type;
					var _invoiceNumber = data[0]._invoiceNumber;
					var _invoicecode = data[0]._invoicecode;
					var _billingDate = data[0]._billingDate;
					if (_invoiceType == "10101" || _json.data[0].type=="10102" || _json.data[0].type=="10103") {
						var _checkCode = data[0]._checkCode;
						blurs(_invoiceType, _invoiceNumber, _invoicecode, _checkCode, _billingDate, "");
					} else {
						var _priceWithoutTax = data[0]._priceWithoutTax;
						blurs(_invoiceType, _invoiceNumber, _invoicecode, "", _billingDate, _priceWithoutTax);
					}
					onCheck_auto();
				}
			}
		} else {
            alert(_json.msg);
		}
	}
	}catch(e){
		alert(e);
	}
	}

    /**
	 * 添加至流程
	 * jsonToSaveAdd 添加至流程时候返回的正确的参数,然后将发票类型_invoiceType放入到其中
     * _invoiceType  发票类型
     */

    function onSave(){
            //如果是普票和专票,不用校验
			var _data=jsonToSaveAdd;
		    _data.imageID=jQuery("#imageID").val();
            _data.operate="SaveAndAdd";   //操作类型
            _data.requestid=_fna_requestid;//请求id
            _data.workflowid=_fna_workflowid;//流程id
            _data.dindex=_fna_dindex;//0为主表,1、2、3等为明细表
            _data._invoiceType=_invoiceType;//发票类型
            //如果是增值税普票或者增值税专票(如果json里面再放一个json,通过ajax传到后台,子json中的数据获取不方便,因此将子json转为字符串传递到后台)
			if(_invoiceType=="10100" || _invoiceType=="10101" || _invoiceType=="10102" || _invoiceType=="10103"){
                _data.detaildata=JSON.stringify(_data.detaildata);
			}

            //如果是火车票
			if(_invoiceType=="10503"){
                var _total=$("#container5-je").val();
                var _station_geton=$("#container5-cfz").val();
                var _station_getoff=$("#container5-ddz").val();
                var _number=$("#container5-hm").val();
                var _seat=$("#container5-zwlx").val();
                var _date=$("#container5-cfsj").val();
                var _train_number=$("#container5-cc").val();
                var _name=$("#container5-ccr").val();
                var _time=$("#container5-sj").val();
                if(_total=="" || _date=="" || _number==""){
                    alert("发票号码、日期和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._station_geton=_station_geton;
                    _data._station_getoff=_station_getoff;
                    _data._number=_number;
                    _data._seat=_seat;
                    _data._date=_date;
                    _data._train_number=_train_number;
                    _data._name=_name;
                    _data._time=_time;
				}
			//如果是出租车发票
			}else if(_invoiceType=="10500"){
                var _number=$("#container6-fphm").val();
                var _code=$("#container6-fpdm").val();
                var _date=$("#container6-kprq").val();
                var _time_geton=$("#container6-scsj").val();
                var _time_getoff=$("#container6-xcsj").val();
                var _mileage=$("#container6-lc").val();
                var _total=$("#container6-je").val();
                if(_number=="" || _code=="" || _date=="" || _total==""){
                    alert("发票号码、发票代码、日期和金额为必填项!");
                    return;
				}else{
                    _data._number=_number;
                    _data._code=_code;
                    _data._date=_date;
                    _data._time_geton=_time_geton;
                    _data._time_getoff=_time_getoff;
                    _data._mileage=_mileage;
                    _data._total=_total;
				}
			//如果是定额发票
			}else if(_invoiceType=="10200") {
                var _total = $("#container7-je").val();
                var _code = $("#container7-fpdm").val();
                var _number = $("#container7-fphm").val();
                if (_number == "" || _code == "" || _total == "") {
                    alert("发票号码、发票代码和金额为必填项!");
                    return;
                } else {
                    _data._number = _number;
                    _data._code = _code;
                    _data._total = _total;
                }
			//如果是机打发票
            }else if(_invoiceType=="10400"){
                var _total=$("#container8-je").val();
                var _code=$("#container8-fpdm").val();
                var _number=$("#container8-fphm").val();
                var _date=$("#container8-kprq").val();
                var _seller=$("#container8-xsfmc").val();
                var _seller_tax_id=$("#container8-xsfnsrsbh").val();
                var _buyer=$("#container8-gmfmc").val();
                var _buyer_tax_id=$("#container8-gmfnsrsbh").val();
                if(_number=="" || _code=="" || _total=="" || _date==""){
                    alert("发票号码、发票代码、日期和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._code=_code;
                    _data._number=_number;
                    _data._date=_date;
                    _data._seller=_seller;
                    _data._seller_tax_id=_seller_tax_id;
                    _data._buyer=_buyer;
                    _data._buyer_tax_id=_buyer_tax_id;
				}
			//如果是二手车/机动车销售统一发票
			}else if(_invoiceType=="10104" || _invoiceType=="10105"){
                var _total=$("#container9-je").val();
                var _number=$("#container9-fphm").val();
                var _code=$("#container9-fpdm").val();
                var _date=$("#container9-kprq").val();
                var _seller=$("#container9-xsfmc").val();
                var _buyer=$("#container9-gmfmc").val();
                if(_number=="" || _code=="" || _total=="" || _date=="") {
                    alert("发票号码、发票代码、日期和金额为必填项!");
                    return;
                }else{
                    _data._total=_total;
                    _data._code=_code;
                    _data._number=_number;
                    _data._date=_date;
                    _data._seller=_seller;
                    _data._buyer=_buyer;
				}
			//如果是国际小票
			}else if(_invoiceType=="20100"){
                var _total=$("#container10-zje").val();
                var _storename=$("#container10-dm").val();
                var _type=$("#container10-xflx").val();
                var _date=$("#container10-rq").val();
                var _time=$("#container10-sj").val();
                if(_total=="" || _date=="" || _storename==""){
                    alert("店名、日期和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._storename=_storename;
                    _data._type2=_type;
                    _data._date=_date;
                    _data._time=_time;
				}
			//如果是客运汽车票
			}else if(_invoiceType=="10505"){
                var _total=$("#container11-je").val();
                var _station_geton=$("#container11-cfz").val();
                var _station_getoff=$("#container11-ddz").val();
                var _number=$("#container11-hm").val();
                var _code=$("#container11-dm").val();
                var _date=$("#container11-cfsj").val();
                var _name=$("#container11-ccr").val();
                var _time=$("#container11-sj").val();
                if(_total=="" || _code=="" || _date=="" || _number==""){
                    alert("发票号码、发票代码、日期和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._station_geton=_station_geton;
                    _data._station_getoff=_station_getoff;
                    _data._number=_number;
                    _data._code=_code;
                    _data._date=_date;
                    _data._name=_name;
                    _data._time=_time;
				}
			//如果是过路费发票
			}else if(_invoiceType=="10507"){
                var _total=$("#container12-je").val();
                var _entrance=$("#container12-rk").val();
                var _exit=$("#container12-ck").val();
                var _number=$("#container12-hm").val();
                var _code=$("#container12-dm").val();
                var _date=$("#container12-cfsj").val();
                var _time=$("#container12-sj").val();
                if(_total=="" || _number=="" || _code=="" || _date==""){
                    alert("发票号码、发票代码、日期和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._entrance=_entrance;
                    _data._exit=_exit;
                    _data._number=_number;
                    _data._code=_code;
                    _data._date=_date;
                    _data._time=_time;
				}
			//如果是航空运输电子客票行程单
			}else if(_invoiceType=="10506"){
                var _total=$("#container13-je").val();
                var _number=$("#container13-hm").val();
                var _check_code=$("#container13-jym").val();
                var _date=$("#container13-kprq").val();
                var _user_name=$("#container13-cjrxm").val();
                if(_total=="" || _number=="" || _check_code==""){
                    alert("发票号码、校验码和金额为必填项!");
                    return;
				}else{
                    _data._total=_total;
                    _data._number=_number;
                    _data._check_code=_check_code;
                    _data._date=_date;
                    _data._user_name=_user_name;
				}
                _data._flights=JSON.stringify(_data._flights);
			}

            jQuery.ajax({

                url:'/mobile/plugin/1/fna/imageOCRAjax.jsp',
                type: 'post',
                data: _data,
                dataType: 'json',
                timeout: 200000,
                success: function (_json) {
                    try{
                        if (_json.flag) {
                            var id = _json.id;
                            var name = _json.name;
                            var dindex = _json.dindex;
                            var fieldid = _json.fieldid;
                            var result = {
                                "dindex" : dindex,
                                "fieldId" : fieldid,
                                "idValue" : id,
                                "nameValue" : name
                            };
                            parent.callbackOk_invoiceScanning(result);
                        }else{
                            alert(_json.msg);
                            if(_json.hasOwnProperty("msgType") && _json.msgType=="TaxpayerNumber"){
                                parent.callbackBack_invoiceScanning();
                            }
                        }
                    }catch(e){}finally{
                        loaded();
                    }
                },
                error: function (XHR, textStatus, errorThrown) {
                    loaded();
                    if (textStatus == 'timeout') {
                        alert('请求超时,请重试!');
                        return false;
                    }
                    alert(XHR.responseText);
                },
                complete:function(){
                    loaded();
                }
            });

    }
    function downCallback(){
        //显示上次文件页面,清空其他
        jQuery("#container2").show();
        //清空图片
        jQuery("#img-div").empty();
        jQuery("#file_head").val("");
        imgsrc = "";
        editPage = "";
        //隐藏发票信息页面元素
        jQuery("#container3,#container4,#container5,#container6,#container7,#container8,#container9,#container10,#container11,#container12,#container13,#container14").hide();
    }
	function inputFocus(){
		if(isAndroid){
			$('#footer-div-check').css('position', 'static');
		}
	}
	
	function showCheckPage(){
		$("#container3").show();
        $("#container2").hide();
		
	}
	
	function showCorrectInfoPage(fplx){
		if("10101" == fplx){
            $("#container2").hide();
			$("#container3").hide();
			$("#container4").show();
		}else if("10100" == fplx){
            $("#container2").hide();
		    $("#container3").hide();
			$("#container4").show();
		}else if("10503" == fplx){
			$("#container2").hide();
			$("#container5").show();
		}else if("10500"==fplx){
			$("#container2").hide();
			$("#container6").show();
		}else if("10200"==fplx){
			$("#container2").hide();
			$("#container7").show();
		}else if("10400"==fplx){
			$("#container2").hide();
			$("#container8").show();
		}else if("10105" == fplx || "10104" == fplx){
			$("#container2").hide();
			$("#container9").show();
		}else if("20100" == fplx){
            $("#container2").hide();
            $("#container10").show();
        }else if("10505"==fplx){
            $("#container2").hide();
            $("#container11").show();
        }else if("10507"==fplx){
            $("#container2").hide();
            $("#container12").show();
        }else if("10506"==fplx){
            $("#container2").hide();
            $("#container13").show();
        }
	}
	
	function blurs(_invoiceType,_invoiceNumber,_invoicecode,_checkCode,_billingDate,_priceWithoutTax){
		if(_invoiceType == "10101" || _invoiceType=="10102" || _invoiceType=="10103"){

			$("#fphm").val(_invoiceNumber);
            $("#fphm").blur();
            $("#fpdm").val(_invoicecode);
            $("#fpdm").blur();
            $("#checkDate").val(_billingDate.replace("年", "-").replace("月", "-").replace("日", ""));
            $("#jym").val(_checkCode);
            $("#jym").blur();
		}else{
			$("#fphm").val(_invoiceNumber);
			$("#fphm").blur();
			$("#fpdm").val(_invoicecode);
			$("#fpdm").blur();
			$("#checkDate").val(_billingDate);
			$("#je").val(_priceWithoutTax);
			$("#je").blur();
		}
	}

	function autoCheck(result){
		loading();
		jQuery.ajax({
            url: '/mobile/plugin/1/fna/invoiceInfoAjax.jsp',
            type: 'post',
            data: {"result":result,"type":"0"},
            dataType: 'json',
            timeout: 60000,
            success: function (_json) {
            	if(_json.status == 1){
                    jsonToSaveAdd=_json;
                    //如果返回的发票类型是 01,02,03则是增值税专用发票,否则是增值税普通发票
            		showCorrectInfoPage((_json.fplx=="01" || _json.fplx=="02" || _json.fplx=="03")? "10100" : "10101");
            		var title = _json.title;
    				var _taxIncludedPrice = _json._taxIncludedPrice;
    				var _priceWithoutTax = _json._priceWithoutTax;
    				var _tax = _json._tax;
    				var _invoiceNumber = _json._invoiceNumber;
    				var _invoicecode = _json._invoicecode;
    				var _purchaser = _json._purchaser;
    				var _seller = _json._seller;

    				var _billingDate = _json._billingDate;
    				var fplx = _json.fplx;
    				var _taxRate = _json._taxRate;
    				var _invoiceServiceYype = _json._invoiceServiceYype;
    				var _checkCode = _json._checkCode;
    				
    				$("#fplx").val(fplx);
                    $("#_taxRate").val(_taxRate);
                    $("#_invoiceServiceYype").val(_invoiceServiceYype);
                    $("#_checkCode").val(_checkCode);
                    $("#span1").text(title);
                    $("#span2").text(_taxIncludedPrice);
                    $("#span3").text(_priceWithoutTax);
                    $("#span4").text(_tax);
                    $("#span5").text(_invoiceNumber);
                    $("#span6").text(_invoicecode);
                    $("#span7").text(_purchaser);
                    $("#span8").text(_seller);
                    $("#span9").text(_billingDate);
            	}else{
            		alert("提示:" + _json.errMsg);
            	}
            },
            error: function (XHR, textStatus, errorThrown) {
            	loaded();
				alert("发票查验失败!");
            },
            complete:function(){
            	loaded();
            }
        });
	}

	function fpdmBlur(){
		if(isAndroid){
			$('#footer-div-check').css('position', 'fixed');
		}
		var fpdm = $("#fpdm").val().trim();
		if (fpdm.length == 10 || fpdm.length == 12) {
			var invoiceType = 0;
			if(fpdm.length == 10){
				var eight = fpdm.substring(7,8);
				if("1" == eight || "2" == eight || "5" == eight || "7" == eight){
					invoiceType = 1;
				}else if("3" == eight || "6" == eight){
					invoiceType = 2;
				}
			}else if(fpdm.length == 12){
				var first = fpdm.substring(0,1);
				var eight = fpdm.substring(7,8);
				var elevenTwelve = fpdm.substring(10,11) + fpdm.substring(11,12);
				if("0" == first && ("04" == elevenTwelve || "05" == elevenTwelve || "06" == elevenTwelve || "07" == elevenTwelve 
						|| "11" == elevenTwelve || "12" == elevenTwelve)){
					invoiceType = 2;
				}
				if("1" == first && "2" == eight){
					invoiceType = 3;
				}
				if("0" == first && "17" == elevenTwelve){
					invoiceType = 4;
				}
			}
			if(invoiceType == 1){
				fplx = 2;
				displayFont(2);
				displayFont(6);
			}else if(invoiceType == 2){
				fplx = 1;
				displayFont(2);
				displayFont(5);
			}else{
				fplx = 0;
				displayFont(1);
			}
		}else{
			fplx = 0;
			displayFont(1);
		}
	}

	function fphmBlur(){
		if(isAndroid){
			$('#footer-div-check').css('position', 'fixed');
		}
		var fphm = $("#fphm").val().trim();
		if (fphm.length == 8){
			displayFont(3);
		}else{
			displayFont(4);
		}
	}
	function jymBlur(){
		if(isAndroid){
			$('#footer-div-check').css('position', 'fixed');
		}
		var jym = $("#jym").val().trim();
		if (jym.length == 6){
			displayFont(7);
		}else{
			displayFont(8);
		}
	}
	function jeBlur(){
		if(isAndroid){
			$('#footer-div-check').css('position', 'fixed');
		}
		var je = $("#je").val().trim();
		if (je.length == 0){
			displayFont(9);
		}else{
			displayFont(10);
		}
	}

	function rqBlur(){
		var checkDate = $("#checkDate").val().trim();
		if (checkDate.length == 0){
			displayFont(13);
		}else{
			displayFont(14);
		}
	}

	function displayFont(type){
		if(type == 1){
			jyfpdm = 0;
			$("#fontDiv11").hide();
			$("#fontDiv21").show();
		}else if(type == 2){
			jyfpdm = 1;
		}else if(type == 3){
			jyfphm = 1;
		}else if(type == 4){
			jyfphm = 0;
		}else if(type == 5){
			$("#dynamic_1").show();
			$("#dynamic_2").hide();
		}else if(type == 6){
			$("#dynamic_1").hide();
			$("#dynamic_2").show();
		}else if(type == 7){
			jyjym = 1;
		}else if(type == 8){
			jyjym = 0;
		}else if(type == 9){
			jyje = 0;
		}else if(type == 10){
			jyje = 1;
		}
	}
	function clearNoNum(obj){ 
	    obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符  
	    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的  
	    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$","."); 
	    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数  
	    if(obj.value.indexOf(".")< 0 && obj.value !=""){//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 
	        obj.value= parseFloat(obj.value); 
	    } 
	}

	function getResult(){
		var result = "";
		var fpdm = $("#fpdm").val();
		var fphm = $("#fphm").val();
		var jym = $("#jym").val();
		var je = $("#je").val();
		var checkDate = $("#checkDate").val().replace("-","").replace("-","");
		if(fplx == 1){
			result = "01,04,"+fpdm+","+fphm+",0.00,"+checkDate+",00000000000"+jym+",0000,";
		}else if(fplx == 2){
			result = "01,01,"+fpdm+","+fphm+","+je+","+checkDate+","+"000000000000000,0000,";
		}
		return result;
	}

	function onCheck_auto(){
		var checkDate = $("#checkDate").val();
		if(fplx == 1){
			if(jyfpdm == 0 || jyfphm == 0 || jyjym == 0 || checkDate == ""){
				alert("请检查所填信息是否正确");
				return false;
			}
		}else if(fplx == 2){
			if(jyfpdm == 0 || jyfphm == 0 || jyje == 0 || checkDate == ""){
				alert("请检查所填信息是否正确");
				return false;
			}	
		}else{
			alert("请检查所填信息是否正确");
			return false;
		}
		var result = getResult();
		autoCheck(result);
	}

	function onBack(){
		parent.callbackBack_invoiceScanning();
	}

    function uploadimage(){
        if(isAndroid && isEMobile){
            $("#image-select").show();
        }
    }

    function takePicture(e,params){
        cancel();
        var url = "emobile:photograph:_p_addPhoto_uploaded:"+params+":"+e.clientY;
        location = url;
    }
    function photoAlbum(e,params){
        cancel();
        var url = "emobile:photochoose:_p_addPhoto_uploaded:"+params+":"+e.clientY;
        location = url;
    }
    function cancel(){
        $("#image-select").hide();
    }

    function addImg(data){
        var base64PicData = "data:image/jpeg;base64,"+data;
        var img = new Image();
        img.src = base64PicData;
        img.id = 'imgPicture';
        img.style.height = "100%";
        img.style.width = "100%";
        jQuery("#img-div").empty();
        jQuery("#img-div").append(img);
        imgsrc = "1";
        $("#fpdm").val("");
        $("#fphm").val("");
        $("#checkDate").val("");
        $("#je").val("");
        $("#jym").val("");
        $("#file_head").val("");
        setTimeout(check,1000);
    }

    function removeImg(){
        jQuery("#img-div").empty();
    }


	
function loading() {
    var mask_bg = document.createElement("div");
    mask_bg.id = "mask_bg";
    mask_bg.style.position = "absolute";
    mask_bg.style.top = "0px";
    mask_bg.style.left = "0px";
    mask_bg.style.width = "100%";
    mask_bg.style.height = "100%";
    mask_bg.style.backgroundColor = "#fff";
    mask_bg.style.opacity = 0.8;
    mask_bg.style.zIndex = 10001;
    mask_bg.style.backgroundImage="url(/mobilemode/apps/fna2/img/loading.gif)";
    mask_bg.style.backgroundRepeat="no-repeat";
    mask_bg.style.backgroundPosition="center";
    document.body.appendChild(mask_bg);
    var mask_msg = document.createElement("div");
    mask_msg.style.position = "absolute";
    mask_msg.style.top = "35%";
    mask_msg.style.left = "20%";
    mask_msg.style.textAlign = "center";
    mask_msg.style.fontSize = "1.1em";
    mask_msg.style.fontWeight = "bold";
    mask_msg.style.padding = "0.5em 3em 0.5em 3em";
    mask_msg.style.zIndex = 10002;
    mask_msg.style.color = "#fff";
    mask_bg.appendChild(mask_msg);
}
function loaded() {
    var mask_bg = document.getElementById("mask_bg");
    if (mask_bg != null)
        mask_bg.parentNode.removeChild(mask_bg);
}

</script>
</body>
</html>