execOrder.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>一键刷单</title>
  5. <style>
  6. body {
  7. font-family: Arial, sans-serif;
  8. text-align: center;
  9. margin: 50px;
  10. background-color: #f4f4f4;
  11. }
  12. button {
  13. padding: 10px 20px;
  14. font-size: 16px;
  15. color: white;
  16. background-color: #007bff;
  17. border: none;
  18. border-radius: 5px;
  19. cursor: pointer;
  20. transition: background-color 0.3s;
  21. margin:0 20px;
  22. }
  23. button:hover {
  24. background-color: #0056b3;
  25. }
  26. .button-link {
  27. text-decoration: none; /* Remove underline from links */
  28. }
  29. #orderCount {
  30. margin-top: 20px;
  31. font-size: 18px;
  32. color: #333;
  33. }
  34. .tip {
  35. margin-bottom: 40px;
  36. color: red;
  37. }
  38. </style>
  39. <script>
  40. function completeOrders() {
  41. // 二次确认
  42. if (confirm("您确定要完成工单吗?")) {
  43. // 这里使用 AJAX 模拟调用
  44. fetch('/runJobOrder', {
  45. method: 'POST' // 或者根据实际情况使用 'GET'
  46. })
  47. .then(response => {
  48. if (!response.ok) {
  49. throw new Error('网络响应不是 OK'); // 如果响应状态不是 2xx, 抛出错误
  50. }
  51. return response.json(); // 返回解析后的 JSON 数据,或者进一步处理错误状态
  52. })
  53. .then(data => {
  54. document.getElementById('orderCount').innerText = `本次共刷 ${data.order_count} 笔工单`;
  55. })
  56. .catch(error => {
  57. console.error('Error:', error);
  58. document.getElementById('orderCount').innerText = '请求失败,请稍后再试';
  59. });
  60. }
  61. }
  62. </script>
  63. </head>
  64. <body>
  65. <div class="tip">注意:如果您是双驰内部网络用户,请通过内网地址进行打标。外部用户请使用外网地址打标。</div>
  66. <button onclick="completeOrders()">一键完成工单</button>
  67. <a href="http://192.168.40.101:40102/pda/index.jsp" target="_blank" class="button-link">
  68. <button style="background-color: #46B39D">内网打标地址</button>
  69. </a>
  70. <a href="http://120.33.205.42:40102/pda/index.jsp" target="_blank" class="button-link">
  71. <button style="background-color: #004175">外网打标地址</button>
  72. </a>
  73. <div id="orderCount"></div>
  74. </body>
  75. </html>