You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

144 lines
5.9 KiB

  1. function reload_Info(httpData){
  2. var chartLeftSpan=$('#chartLeftSpan');
  3. var chartLeftSpanStr=chartLeftSpan.html();
  4. chartLeftSpanStr=chartLeftSpanStr.replace('[订单号]',httpData['orderID']);
  5. chartLeftSpanStr=chartLeftSpanStr.replace('[是否入住]',httpData['ifstay']);
  6. chartLeftSpanStr=chartLeftSpanStr.replace('[分销商(上海驴妈妈)]',httpData['orderCome']);
  7. chartLeftSpanStr=chartLeftSpanStr.replace('[酒店]',httpData['saleStyle']);
  8. chartLeftSpan.html(chartLeftSpanStr);
  9. var orderCount=$('#orderCount');
  10. var orderCountStr=orderCount.html();
  11. orderCountStr=orderCountStr.replace('[a]',httpData['orderCount']);
  12. orderCountStr=orderCountStr.replace('[b]',httpData['messageCount']);
  13. orderCountStr=orderCountStr.replace('[c]',httpData['orderAttachment']);
  14. orderCount.html(orderCountStr);
  15. //提交订单
  16. var commitOrder=$('#commitOrder');
  17. var commitOrderStr=commitOrder.html();
  18. commitOrderStr=commitOrderStr.replace('[2016.03.02]',httpData['commitDay']);
  19. commitOrderStr=commitOrderStr.replace('[20:30]',httpData['commitTime']);
  20. commitOrder.html(commitOrderStr);
  21. //确认
  22. var affirmOrder=$('#affirmOrder');
  23. var affirmOrderStr=affirmOrder.html();
  24. affirmOrderStr=affirmOrderStr.replace('[2016.03.02]',httpData['affirmDay']);
  25. affirmOrderStr=affirmOrderStr.replace('[20:30]',httpData['affirmTime']);
  26. affirmOrder.html(affirmOrderStr);
  27. //付款
  28. var payOrder=$('#payOrder');
  29. var payOrderStr=payOrder.html();
  30. payOrderStr=payOrderStr.replace('[2016.03.02]',httpData['payDay']);
  31. payOrderStr=payOrderStr.replace('[20:30]',httpData['payTime']);
  32. payOrder.html(payOrderStr);
  33. //通知
  34. var attentionOrder=$('#attentionOrder');
  35. var attentionOrderStr=attentionOrder.html();
  36. attentionOrderStr=attentionOrderStr.replace('[2016.03.02]',httpData['attentionDay']);
  37. attentionOrderStr=attentionOrderStr.replace('[20:30]',httpData['attentionTime']);
  38. attentionOrder.html(attentionOrderStr);
  39. //安排
  40. var arrangeOrder=$('#arrangeOrder');
  41. var arrangeOrderStr=arrangeOrder.html();
  42. arrangeOrderStr=arrangeOrderStr.replace('[2016.03.02]',httpData['arrangeDay']);
  43. arrangeOrderStr=arrangeOrderStr.replace('[20:30]',httpData['arrangeTime']);
  44. arrangeOrder.html(arrangeOrderStr);
  45. //入住酒店
  46. var checkIn=$('#checkIn');
  47. var checkInStr=checkIn.html();
  48. checkInStr=checkInStr.replace('[2016.03.02]',httpData['checkInTimeGo']);
  49. checkInStr=checkInStr.replace('[2016.03.02]',httpData['checkInTimeOut']);
  50. checkIn.html(checkInStr);
  51. $('#startarea').html(httpData['product']+' '+httpData['bedStyle']);
  52. $('#starttime').html(httpData['bookSale']+'  |  '+httpData['company']+'&nbsp'+httpData['orderNumber']);
  53. var getTime=$('#getTime');
  54. var timeStr=getTime.html();
  55. timeStr=timeStr.replace('[出发日期]',httpData['stayTime']);
  56. timeStr=timeStr.replace('[t]',httpData['totalNo']);
  57. timeStr=timeStr.replace('[小时]',httpData['lastTime']);
  58. getTime.html(timeStr);
  59. //入住日期
  60. var bookInfo=httpData['bookInfo'];
  61. var stayTime=$("#stayTime");
  62. var tttHTML=$('#tr_one').prop('outerHTML');
  63. var newHTML=''
  64. for(var i=0;i<bookInfo.length;i++){
  65. var tempDict=bookInfo[i];
  66. var tempHTML=tttHTML;
  67. tempHTML=tempHTML.replace('[入住日期]',tempDict['startTime']);
  68. tempHTML=tempHTML.replace('[数量]',tempDict['count']);
  69. tempHTML=tempHTML.replace('[采购价]',tempDict['buyPrice']);
  70. tempHTML=tempHTML.replace('[结算价]',tempDict['endPrice']);
  71. tempHTML=tempHTML.replace('[零售价]',tempDict['salePrice']);
  72. tempHTML=tempHTML.replace('[采购价金额]',tempDict['buy']);
  73. tempHTML=tempHTML.replace('[结算价金额]',tempDict['end']);
  74. tempHTML=tempHTML.replace('[销售利润]',tempDict['profit']);
  75. newHTML+=tempHTML;
  76. }
  77. var total = $('#tr_total').prop('outerHTML');
  78. total = total.replace('[总采购价金额]',httpData['bookTotalBuy']);
  79. total = total.replace('[总结算价金额]',httpData['bookTotalEnd']);
  80. total = total.replace('[总销售利润]',httpData['bookTotalProfit']);
  81. newHTML+=total;
  82. stayTime.html(newHTML);
  83. //续住晚数
  84. var bookInfoContinue=httpData['bookInfoContinue'];
  85. var continueStay=$("#continueStay");
  86. var tttHTML=$('#tr_one_cont').prop('outerHTML');;
  87. var newHTML=''
  88. for(var i=0;i<bookInfoContinue.length;i++){
  89. var tempDict=bookInfoContinue[i];
  90. var tempHTML=tttHTML;
  91. tempHTML=tempHTML.replace('[入住日期]',tempDict['startTime']);
  92. tempHTML=tempHTML.replace('[库存]',tempDict['stock']);
  93. tempHTML=tempHTML.replace('[数量]',tempDict['count']);
  94. tempHTML=tempHTML.replace('[采购价]',tempDict['buyPrice']);
  95. tempHTML=tempHTML.replace('[结算价]',tempDict['endPrice']);
  96. tempHTML=tempHTML.replace('[零售价]',tempDict['salePrice']);
  97. tempHTML=tempHTML.replace('[采购价金额]',tempDict['buy']);
  98. tempHTML=tempHTML.replace('[结算价金额]',tempDict['end']);
  99. tempHTML=tempHTML.replace('[销售利润]',tempDict['profit']);
  100. newHTML+=tempHTML;
  101. }
  102. var totalContinue = $('#tr_totalContinue').prop('outerHTML');
  103. totalContinue = totalContinue.replace('[总采购价金额]',httpData['bookTotalBuyContinue']);
  104. totalContinue = totalContinue.replace('[总结算价金额]',httpData['bookTotalEndContinue']);
  105. totalContinue = totalContinue.replace('[总销售利润]',httpData['bookTotalProfitContinue']);
  106. newHTML+=totalContinue;
  107. continueStay.html(newHTML);
  108. }
  109. window.onload=function (){
  110. get_virtual_user_list('./json/keepStayJson.html');
  111. }
  112. /*======================网络请求的Ajax的代码=======================*/
  113. // 创建一个Ajax对象
  114. if (window.ActiveXObject){
  115. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  116. }else{
  117. var myreq = new XMLHttpRequest();
  118. }
  119. // 请求方法,传入URL
  120. function get_virtual_user_list(myURL)
  121. {
  122. myreq.open("get",myURL,true);
  123. // 接收的数据交给哪个函数处理
  124. myreq.onreadystatechange = show_user_list;
  125. myreq.send();
  126. }
  127. function show_user_list()
  128. {
  129. if (myreq.readyState == 4)
  130. {
  131. // newstr 就是接收到的数据
  132. var newstr = myreq.responseText;
  133. var httpData=JSON.parse(newstr);
  134. reload_Info(httpData);
  135. }
  136. }